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 run --rm does not remove automatically created volumes #3967

Closed
neVERberleRfellerER opened this issue Sep 7, 2019 · 8 comments
Closed
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@neVERberleRfellerER
Copy link
Contributor

/kind feature

Description

podman run --rm does not remove automatically created volumes. This is different from docker run --rm as described in https://docs.docker.com/engine/reference/run/#clean-up---rm .

Steps to reproduce the issue:

  1. podman run --rm --name pg1 -d postgres

  2. podman stop pg1

  3. podman volume ls

Describe the results you received:
Automatically created volume. Every reproduction step leaves one more volume. Containers with more volumes leave behind more volumes.

Describe the results you expected:
No new volumes left behind after container started with --rm stops.

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

Output of podman version:

Version:            1.5.1
RemoteAPI Version:  1
Go Version:         go1.12.8
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12.8
  podman version: 1.5.1
host:
  BuildahVersion: 1.10.1
  Conmon:
    package: Unknown
    path: /usr/bin/conmon
    version: 'conmon version 2.0.0, commit: e217fdff82e0b1a6184a28c43043a4065083407f'
  Distribution:
    distribution: arch
    version: unknown
  MemFree: 10514563072
  MemTotal: 16743772160
  OCIRuntime:
    package: Unknown
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc8
      commit: 425e105d5a03fabd737a126ad93d62a9eeede87f
      spec: 1.0.1-dev
  SwapFree: 17179865088
  SwapTotal: 17179865088
  arch: amd64
  cpus: 16
  eventlogger: file
  hostname: myhost
  kernel: 5.2.11-arch1-1-ARCH
  os: linux
  rootless: true
  uptime: 1h 36m 52.75s (Approximately 0.04 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/user/.config/containers/storage.conf
  ContainerStore:
    number: 2
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/user/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 9
  RunRoot: /run/user/1000
  VolumePath: /home/user/.local/share/containers/storage/volumes

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

podman 1.5.1-1

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

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 7, 2019
@mheon
Copy link
Member

mheon commented Sep 7, 2019

We changed this in the other direction in #3071 - need to figure out what's going on here.

@mheon
Copy link
Member

mheon commented Sep 7, 2019

Only volumes that are specified without a name are removed

Well, that simplifies matters. We don't have support for anonymous named volumes yet, I think.

@neVERberleRfellerER
Copy link
Contributor Author

neVERberleRfellerER commented Sep 7, 2019

Now that I think about it, docker docs might not even have any power over this particular issue, since docs only deal with specified volumes, but my problem is with unspecified volumes (volumes created automatically by podman when -v was not specified). Not sure how docker handles unspecified volumes. Previously, I was under bad impression that automatically created volumes are anonymous volumes, but they are something different (and indeed, they are not supported by podman yet).

@github-actions
Copy link

This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days.

@mheon
Copy link
Member

mheon commented Oct 31, 2019

This is actually fixed now - we landed support for anonymous volumes recently.

@mheon mheon closed this as completed Oct 31, 2019
@Gigadoc2
Copy link

Gigadoc2 commented Feb 6, 2020

Do note that this now results in volumes created with older versions of podman (those that do not show up with a DRIVER in podman volume list) being deleted when used in combination with podman run --rm, even though they are explicitly named.

@mheon
Copy link
Member

mheon commented Feb 6, 2020

Will be fixed in 1.8.0. Unfortunately, that fix also has to go a little far to the other side (even unnamed volumes from old Podman versions will not be removed) - but this is safer than removing volumes that we shouldn't.

@Gigadoc2
Copy link

Gigadoc2 commented Feb 6, 2020

After having kind of lost a Nextcloud installation today, I fully agree with you on that 😅

@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

4 participants