Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Docker gc lists images to remove which are present in exclude file #191

Closed
sandeep-paliwal opened this issue Jul 24, 2018 · 2 comments
Closed
Labels

Comments

@sandeep-paliwal
Copy link

Description

Image mentioned in /etc/docker-gc-exclude is not getting honoured by docker-gc and it shows up as image which will be removed.

[Add feature/bug description here]

How to reproduce

I am running docker-gc as docker container with following command to test out docker-gc run

docker run --rm --userns host -e GRACE_PERIOD_SECONDS=60 -e DRY_RUN=1 -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc spotify/docker-gc

I have exclude file created at following location /etc/docker-gc-exclude. This file has following content

99dea4a29c24
spotify/cassandra:latest
redis:.*

When I run docker-gc with the command mentioned above I see following output in console

[2018-07-24T06:12:05] [INFO] : The following image would have been removed sha256:481995377a044d40ca3358e4203fe95eca1d58b98a1d4c2d9cec51c0c4569613 [redis:2.8]

What do you expect

As I had mentioned redis:.* in exclude file I expected the image name should not show up as one which will be removed

What happened instead

[Describe the actual results]

Software:

  • bash version: [Add bash version here]

Full backtrace

[Paste full backtrace here]
@cmtjk
Copy link

cmtjk commented Jul 30, 2018

I can confirm that this currently doesn't work as expected. compute_exclude_ids() seems to work properly, but its result is not correctly processed later.

UPDATE: I was not able to reproduce the issue on Solus 3 with

Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.10.3
 Git commit:   
 Built:        Wed Jul 25 08:11:59 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.3
  Git commit:   f150324782643a5268a04e7d1a675587125da20e
  Built:        Wed Jul 25 08:11:43 2018
  OS/Arch:      linux/amd64
  Experimental: false

but it's present on Ubuntu (16.10), which might have dated commands/software used in docker-gc.

@sandeep-paliwal, which OS are you running?

@stale
Copy link

stale bot commented Nov 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 22, 2018
@stale stale bot closed this as completed Nov 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants