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

gc exclude pattern not working properly #145

Closed
@n3ziniuka5

Description

@n3ziniuka5

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions