From 9e1bf844cf821351eff05fbd83ca1317490df6a0 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 11 Jan 2021 02:50:57 +0200 Subject: [PATCH] also tag image with short version --- bin/build_docker.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/build_docker.sh b/bin/build_docker.sh index 0115acdf..42fade38 100755 --- a/bin/build_docker.sh +++ b/bin/build_docker.sh @@ -12,6 +12,7 @@ IFS=$'\n' REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )" VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")" +SHORT_VERSION="$(echo "$VERSION" | perl -pe 's/(\d+)\.(\d+)\.(\d+)/$1.$2/g')" cd "$REPO_DIR" which docker > /dev/null @@ -20,9 +21,13 @@ echo "[+] Building docker image in the background..." docker build . -t archivebox \ -t archivebox:latest \ -t archivebox:$VERSION \ + -t archivebox:$SHORT_VERSION \ -t docker.io/nikisweeting/archivebox:latest \ -t docker.io/nikisweeting/archivebox:$VERSION \ + -t docker.io/nikisweeting/archivebox:$SHORT_VERSION \ -t docker.io/archivebox/archivebox:latest \ -t docker.io/archivebox/archivebox:$VERSION \ + -t docker.io/archivebox/archivebox:$SHORT_VERSION \ -t docker.pkg.github.com/pirate/archivebox/archivebox:latest \ - -t docker.pkg.github.com/pirate/archivebox/archivebox:$VERSION + -t docker.pkg.github.com/pirate/archivebox/archivebox:$VERSION \ + -t docker.pkg.github.com/pirate/archivebox/archivebox:$SHORT_VERSION