-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Failed to prune image: image is in use by a container #3983
Comments
Thanks for the issue @bmapuin. You've added a link to #3982, I just wanted to note that further background discussion can be found there. |
Podman is not the only user of containers/storage, and as such we cannot rely on our database as the sole source of truth when pruning images. If images do not show as in use from Podman's perspective, but subsequently fail to remove because they are being used by a container, they're probably being used by Buildah or another c/storage client. Since the images in question are in use, we shouldn't error on failure to prune them - we weren't supposed to prune them in the first place. Fixes: containers#3983 Signed-off-by: Matthew Heon <[email protected]>
#3984 to fix |
I don't understand how I'm the first one to encounter this issue. Am I the only podman user using both |
From issue reports I've seen, most people are using |
You're not alone. [jilin]~> podman container list
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[jilin]~> podman image prune
Error: failed to prune image: Image used by 62d0dcaf932e512f8f57d728adb3cd7cf00027ec03deb9d254f53071bd2c1ec4: image is in use by a container
[jilin]~> podman container kill 62d0dcaf932e512f8f57d728adb3cd7cf00027ec03deb9d254f53071bd2c1ec4
Error: no container with name or ID 62d0dcaf932e512f8f57d728adb3cd7cf00027ec03deb9d254f53071bd2c1ec4 found: no such container Pretty mysterious. (I never use |
Ran into this today, given that buildah/podman are typically used together (iirc, the latter calls the former's libraries when building images), figured that something was amiss with the former when I was seeing this behavior with the latter:
However, |
This seems to have happened to me after interrupting (via Ctrl-c) a parallel build with For reference, the |
I get the same error and don't even have buildah installed. |
Try the command You can also check directly in |
Usually external containers come from broken podman builds or running buildah. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I'm frequently unable to run
podman prune -a
because I get the following error:More info:
Steps to reproduce the issue:
See Description
Describe the results you received:
See Description
Describe the results you expected:
I would've expected
podman image prune -a
to work the same waydocker image prune -a
does:https://docs.docker.com/engine/reference/commandline/image_prune/#options
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
Physical machine running Ubuntu 18.04.
Thanks!
The text was updated successfully, but these errors were encountered: