Skip to content

Improvement: Allow dockerPush to target multiple repositories #195

Closed
@BenedictRasmussen

Description

We have a use case where we need to create an image and push it to multiple repositories To accomplish this now, we create a single image, tag it multiple times, then push to all repositories. For example:

docker build -t repository01.com:2018.08.23 .
docker tag repository01.com:2018.08.23 repository02.com:2018.08.23
docker tag repository01.com:2018.08.23 repository03.com:2018.08.23

docker push repository01.com:2018.08.23
docker push repository02.com:2018.08.23
docker push repository03.com:2018.08.23

Currently gradle-docker can accept multiple tags when creating an image, but this is only applied to the actual docker tag after the colon. I am proposing allowing users to specify multiple names in addition to multiple tags. Each tag would then be applied to each name. When the user runs gradle dockerPush, it cleans / prepares / execs / as usual. During the tag step, the names list is iterated and a tag applied to each name, then during the push step, every : pair is pushed.

This is something I am willing to work on in my spare time if the maintainers think this would be a useful feature.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions