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

1.13.0 - system prune vs. images -f dangling=true: different behaviour #30307

Closed
RRAlex opened this issue Jan 20, 2017 · 4 comments
Closed

1.13.0 - system prune vs. images -f dangling=true: different behaviour #30307

RRAlex opened this issue Jan 20, 2017 · 4 comments

Comments

@RRAlex
Copy link

RRAlex commented Jan 20, 2017

Description
docker system prune -f is supposed to remove dangling images but images tagged <none> aren't necessarily removed.
Meanwhile, docker rmi $(docker images -f dangling=true) will remove more images.
Something is not coherent in one of those?

Steps to reproduce the issue:

  1. Pull an image by a digest (docker pull image@sha256:...)
  2. docker system prune -f
  3. docker rmi $(docker images -f dangling=true)

Describe the results you received:
3rd command above still deletes an image.

Describe the results you expected:
Prune should have done all the work before the last command.

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

Output of docker version:

Client:
 Version:      1.13.0
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   49bf474
 Built:        Tue Jan 17 09:58:26 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.0
 API version:  1.25 (minimum version 1.12)
 Go version:   go1.7.3
 Git commit:   49bf474
 Built:        Tue Jan 17 09:58:26 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

 Running: 0
 Paused: 0
 Stopped: 0
Images: 23
Server Version: 1.13.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 31
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e
runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-59-generic
Operating System: Linux Mint 18
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 30.99 GiB
Name: octet
ID: Z6SL:RSSC:M7BQ:NXJX:KHVZ:7IAZ:TIO2:G2QP:HKVC:NM76:ZWOH:KMVC
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

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

@AlekSi
Copy link

AlekSi commented Jan 20, 2017

I would like docker system prune to remove untagged images. If this is not going to be a default behavior, can we have a flag for that? It's useful after pulling newest latest images.

@mlaventure
Copy link
Contributor

@AlekSi try using the -a flag. By default it was decided not to remove images without a container attached to them as people may just be using the machine as a build machine and doing so would erase their cache.

@AlekSi
Copy link

AlekSi commented Jan 24, 2017

I use Docker with Drone CI. I don't want to remove, for example, latest mysql:5.7 even if it doesn't have a container, but I want to remove previous versions of this tag. -a would remove the latest version, without this flag previous versions will not be removed.

I wonder what images docker system prune without -a removes?

This issue is about a difference in behavior and definition of the word "dangling". If you want to keep it, then I think:

  1. Help message should be updated to describe what would be removed.
  2. Some flag should be added to remove all untagged images.

@mlaventure
Copy link
Contributor

@AlekSi oh, I didn't understand your first comment it seems.

#30330 should fix system prune so it also removes untagged images hence matching dangling definition in docker image -f dangling=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants