How to move the Podman Temporary Container Image Storage location



Overview of the Issue

During the installation of a vFunction Server on a Linux VM using Podman, vFunction loads the Container Images into the temporary Podman Storage location. Podman uses the location set in the environmental variable TMPDIR for loading images. By default, this location is /var/tmp/. This temporary storage can take up to 15gb of space temporarily before writing the Container Images to the permanent storage location.

During an installation or upgrade of the environment, the following error may be thrown indicating there is no space left on device in the /var/tmp directory:

Copying blob 829ed5f3f196 done    |
Error: payload does not match any of the supported image formats:
 * oci: open /path/to/vfunction/opt/vfunction/server-installation/images/vfunction-vfapi-measurements-ubi.tgz/index.json: 
      not a directory
 * oci-archive: loading index: open /var/tmp/container_images_oci13875065188/index.json: 
      no such file or directory
 * docker-archive: writing blob: storing blob to file "/var/tmp/container_images_storage4144114357/2": 
      write /var/tmp/container_images?storage4144114357/2: no space left on device
 * dir: open /path/to/vfunction/opt/vfunction/server-installation/images/vfunction-vfapi-measurements-ubi.tgz/manifest.json: 
      not a directory
 Something went wrong while trying to load the offline image vfunction-vfapi-measurements-ubi.tgz
 Please verify that you have at least 5G of free space on your "/var/lib/docker" file system. Exiting.

Solution to the Problem

To change the location where these Container Images are temporarily being stored, take the following steps:

  1. Run echo ‘export TMPDIR=/path/to/desired/location’ » ~/.profile
  2. Restart the shell and relogin. Or, add the environmental variable to the current shell session by running export TMPDIR=/path/to/desired/location
  3. Run the vFunction install.sh or upgrade.sh script again