1
0
mirror of https://github.com/tmaier/docker-compose synced 2024-11-22 16:01:59 +01:00

Change approach for tagging the docker image

Past: docker version
Now: docker compose version

Reasoning: We need to do larger changes to the Dockerfile to support Docker Compose v2
This commit is contained in:
Tobias Ludwig Maier 2022-11-01 02:29:23 +01:00
parent 8ab198f3cf
commit c3599cc962
5 changed files with 32 additions and 12 deletions

@ -1,3 +1,2 @@
latest latest
20 1.29.*
20.10 1.29.* 20.10 1.29.*

@ -10,10 +10,10 @@ This is very useful for CI pipelines, which leverage "Docker in Docker".
## Docker versions supported ## Docker versions supported
There are versions based on different docker versions, e.g. `latest`, `20.10`, `19.03` and `19`. Note: In the past. this docker image (tags) focused on the docker version (e.g. `latest`, `20.10`, `19.03` and `19`).
But as the docker releases got less disruptive, the approach changes to use the docker compose version as tags.
docker-compose matches the latest version compatible with the respective docker release. The Docker Compose versions supported here use the most recent docker version compatible with it.
Eg, `20.10` includes docker-compose 1.27.4. The `latest` tag always includes the latest docker-compose build.
All available Docker Engine versions and the respective Docker Compose versions are defined in [`DOCKER_AND_COMPOSE_VERSION_MATRIX`](./DOCKER_AND_COMPOSE_VERSION_MATRIX). All available Docker Engine versions and the respective Docker Compose versions are defined in [`DOCKER_AND_COMPOSE_VERSION_MATRIX`](./DOCKER_AND_COMPOSE_VERSION_MATRIX).

@ -1,10 +1,17 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -ex set -e
while read -r docker_version compose_version; while read -r docker_version compose_version;
do do
image=${DOCKER_REPO}:${docker_version} if [ -z "${compose_version}" ]
then
tag="latest"
else
tag="${compose_version%.*}"
fi
image=${DOCKER_REPO}:${tag}
echo "# Building image ${image}..." echo "# Building image ${image}..."
docker build \ docker build \

@ -1,10 +1,17 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -ex set -e
while read -r docker_version _; while read -r _ compose_version;
do do
image=${DOCKER_REPO}:${docker_version} if [ -z "${compose_version}" ]
then
tag="latest"
else
tag="${compose_version%.*}"
fi
image=${DOCKER_REPO}:${tag}
echo "# Pushing image ${image}..." echo "# Pushing image ${image}..."
docker image push "${image}" docker image push "${image}"

@ -1,10 +1,17 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -ex set -e
while read -r docker_version _; while read -r docker_version compose_version;
do do
image=${DOCKER_REPO}:${docker_version} if [ -z "${compose_version}" ]
then
tag="latest"
else
tag="${compose_version%.*}"
fi
image=${DOCKER_REPO}:${tag}
echo "# Testing image ${image}..." echo "# Testing image ${image}..."
export IMAGE_NAME="${image}" export IMAGE_NAME="${image}"