Added support for versioned docker tags (finally)

This commit is contained in:
Seednode 2023-11-05 08:32:11 -06:00
parent 61ea0b9670
commit ad8309e304
1 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,7 @@ registry="${REGISTRY:-local}"
image_name="roulette" image_name="roulette"
# set image version # set image version
image_version="latest" image_version="$(grep "ReleaseVersion" ../cmd/root.go | head -n1 | awk '{print $4}' | sed 's/\"//g')"
# platforms to build for # platforms to build for
platforms="linux/amd64" platforms="linux/amd64"
@ -26,6 +26,7 @@ platforms+=",linux/ppc64le"
docker buildx build \ docker buildx build \
--build-arg TAG="${tag}" \ --build-arg TAG="${tag}" \
-t "${registry}/${image_name}:${image_version}" \ -t "${registry}/${image_name}:${image_version}" \
$(if [ "${LATEST}" == "yes" ]; then echo "-t ${registry}/${image_name}:latest"; fi) \
-f Dockerfile . \ -f Dockerfile . \
--load --load
@ -33,5 +34,6 @@ docker buildx build \
docker buildx build --platform "${platforms}" \ docker buildx build --platform "${platforms}" \
--build-arg TAG="${tag}" \ --build-arg TAG="${tag}" \
-t "${registry}/${image_name}:${image_version}" \ -t "${registry}/${image_name}:${image_version}" \
$(if [ "${LATEST}" == "yes" ]; then echo "-t ${registry}/${image_name}:latest"; fi) \
-f Dockerfile . \ -f Dockerfile . \
--push --push