From ad8309e304e6d3648c2d509d9d0b40856bf463ae Mon Sep 17 00:00:00 2001 From: Seednode Date: Sun, 5 Nov 2023 08:32:11 -0600 Subject: [PATCH] Added support for versioned docker tags (finally) --- docker/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index f93b97e..c20928a 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -14,7 +14,7 @@ registry="${REGISTRY:-local}" image_name="roulette" # 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="linux/amd64" @@ -26,6 +26,7 @@ platforms+=",linux/ppc64le" docker buildx build \ --build-arg TAG="${tag}" \ -t "${registry}/${image_name}:${image_version}" \ + $(if [ "${LATEST}" == "yes" ]; then echo "-t ${registry}/${image_name}:latest"; fi) \ -f Dockerfile . \ --load @@ -33,5 +34,6 @@ docker buildx build \ docker buildx build --platform "${platforms}" \ --build-arg TAG="${tag}" \ -t "${registry}/${image_name}:${image_version}" \ + $(if [ "${LATEST}" == "yes" ]; then echo "-t ${registry}/${image_name}:latest"; fi) \ -f Dockerfile . \ --push