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

gc exclude pattern not working properly #145

Closed
n3ziniuka5 opened this issue Dec 1, 2016 · 2 comments
Closed

gc exclude pattern not working properly #145

n3ziniuka5 opened this issue Dec 1, 2016 · 2 comments
Labels

Comments

@n3ziniuka5
Copy link

I am using the latest spotify/docker-gc image.

My current images:

nginx                       a1.11.6             abf312888d13        2 days ago          181.5 MB
nginx                       1.11.5              05a60462f8ba        3 weeks ago         181.5 MB
nginx                       <none>              e43d811ce2f4        5 weeks ago         181.5 MB
nginx                       <none>              a5311a310510        7 weeks ago         181.5 MB

I have manually retaged 1.11.6 as a1.11.6 for pattern testing purposes.

I want to remove untagged images, my /etc/docker-gc-exclude file:

nginx:.*[0-9].*

Running docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc -e FORCE_CONTAINER_REMOVAL=1 spotify/docker-gc does not remove any images.

If i change the pattern to nginx:[0-9].* it will remove both untaged images and a1.11.6.



The .*[0-9].* pattern works well with grep. If I create a file named test with contents:

nginx:<none>
nginx:1.11.5
nginx:a1.11.6

and then do cat test | grep .*[0-9].* it will return the expected result:

nginx:1.11.5
nginx:a1.11.6
@n3ziniuka5 n3ziniuka5 changed the title gc exlude pattern not working properly gc exclude pattern not working properly Dec 1, 2016
@ownaginatious
Copy link

You could try my solution in PR #130. That may fix this as well.

@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