Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman always uses /var/tmp for loading docker images and not removing the files after loading #5411

Closed
PieperCH opened this issue Mar 6, 2020 · 4 comments · Fixed by #5412
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@PieperCH
Copy link

PieperCH commented Mar 6, 2020

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

When using podman load with image on commandline it always creates temporary files in /var/tmp. This is ok for temporary usage, but as podman doesn't remove the file afterwards. It's also hardcoded to use /var/tmp for loading the files.
As a result /var/tmp is running out of memory when loading a lot of images
Giving TMPDIR bash variable and --tmpdir doesn't help, as it seems to be hardcoded in load.go in line 78.

Steps to reproduce the issue:

  1. Set variable TMPDIR to some other directory <tmpdir>

  2. Load a .tar.gz into storage with podman load --tmpdir=<tmpdir> -i <filename>

  3. Check /var/tmp directory for files called docker-tar*

Describe the results you received:
/var/tmp is running out of memory when loading a lot of images

Describe the results you expected:
Two options:
1.) Delete /var/tmp/docker-tar file after loading
2.) Give the possibility to specify another directory

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:
Version: 1.4.4
RemoteAPI Version: 1
Go Version: go1.10.3
OS/Arch: linux/amd64

Output of podman info --debug:
debug:
compiler: gc
git commit: ""
go version: go1.10.3
podman version: 1.4.4
host:
BuildahVersion: 1.9.0
Conmon:
package: podman-1.4.4-4.el7.x86_64
path: /usr/libexec/podman/conmon
version: 'conmon version 0.3.0, commit: unknown'
Distribution:
distribution: '"rhel"'
version: "7.7"
MemFree: 1229807616
MemTotal: 16647565312
OCIRuntime:
package: runc-1.0.0-65.rc8.el7.x86_64
path: /usr/bin/runc
version: 'runc version spec: 1.0.1-dev'
SwapFree: 5368172544
SwapTotal: 5368705024
arch: amd64
cpus: 4
hostname: d-sccp-pod-1.draco-242.sccloudres.net
kernel: 3.10.0-1062.12.1.el7.x86_64
os: linux
rootless: true
uptime: 20h 21m 44.21s (Approximately 0.83 days)
registries:
blocked: null
insecure: null
search:

  • registry.access.redhat.com
  • docker.io
  • registry.fedoraproject.org
  • quay.io
  • registry.centos.org
    store:
    ConfigFile: /home/sccp/.config/containers/storage.conf
    ContainerStore:
    number: 0
    GraphDriverName: vfs
    GraphOptions: null
    GraphRoot: /pod/sccp/.local/share/containers/storage
    GraphStatus: {}
    ImageStore:
    number: 2
    RunRoot: /pod/sccp/tmp/run-1002
    VolumePath: /pod/sccp/.local/share/containers/storage/volumes

Package info (e.g. output of rpm -q podman or apt list podman):

podman-1.4.4-4.el7.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 6, 2020
@karlyeurl
Copy link

karlyeurl commented Mar 6, 2020

It's amusing that I was preparing a similar bug report, because I encountered yesterday the same issue in an environment where /var is on a ridiculously small partition.

I would like to point out that libpod/runtime_img.go also contains two ocurrences of ioutil.TempFile with a hardcoded reference to /var/tmp.

If there is no good reason to force these values, I can make a PR with the necessary changes.

(Note: github.com/containers/image/v5 also refers to this directory for the builtinUnixTempDirForBigFiles, I wonder if that needs to be looked at as well.)

@vincentbernat
Copy link

Half of this bug is now fixed (we can choose another directory). The other half is not: after loading an image, the docker-tar* files are kept in the temporary location.

@rhatdan
Copy link
Member

rhatdan commented Mar 2, 2022

Could you give me an exact reproducer?
And show me the left over files.

@rhatdan
Copy link
Member

rhatdan commented Mar 2, 2022

BTW You should open a new issue not add to a closed issue.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants