Update Docker image semver tags in a Docker Compose file to the latest semver tags.
When run locally, this project requires the following dependencies:
Otherwise, when run as a Docker container, there is no need to worry about these dependencies.
Let us begin with an example compose file named compose.yaml
$ cat /home/user/examples/compose.yaml >> --- >> services >> ... >> service-to-update >> image: registry.io/john-doe/hello-world:v1.2.2 >> ...
Assume that we want to update the image john-doe/hello-world
hosted on the
registry registry.io
with the tag develop
, i.e., we want to match the
semantic version of registry.io/john-doe/hello-world:develop
. To accomplish
this, we can do one of the following:
Clone this repository, install the dependencies, and run the script.
git clone https://github.com/arifer612/docker-tag-updater
cd docker-tag-updater
poetry install --only main
poetry run ./compose-updater.sh -t develop -f /home/user/examples/compose.yaml \
registry.io/john-doe/hello-world
To update the image john-doe/hello-world
hosted on the registry registry.io
with the tag develop
, i.e., you want to match the semantic version of
registry.io/john-doe/hello-world:develop
, you can do the following:
$ cd /home/user/examples && \
docker run --rm ghcr.io/arifer612/docker-tag-updater \
registry.io/john-doe/hello-world develop