How to change the location of imageCopyTmpDir for podman ?
Environment
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- podman 4
Issue
- What is imageCopyTmpDir in podman ?
- How to change imageCopyTmpDir location ?
Resolution
- Podman 4.x temporarily stores the data when pulling and building the image and this location is defined by the parameter
imageCopyTmpDir
# podman info | grep imageCopyTmpDir
imageCopyTmpDir: /var/tmp
- This can temporarily be changed by running the below command,
# export TMPDIR=/var/tmp/testdir
Note that /var/tmp/testdir
is mentioned as an example. Any location can be specified as per the requirement.
- To permanently change the location, a parameter needs to be added in /usr/share/containers/containers.conf
file under [engine]
section.
[engine]
env = ["TMPDIR=/var/tmp/testdir"]
- Verify the same from
# podman info
[root@vm254-80 ~]# podman info | grep imageCopyTmpDir
imageCopyTmpDir: /var/tmp/testdir
Note: This change applies for all the users(root and rootless) in the host.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.