From 4668443be6796fc83a46059bfaecc6b48e6c9123 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Tue, 28 Feb 2023 13:20:08 +0200 Subject: [PATCH] install: Use the full image tag Use the full image tag (dangerzone.rocks/dangerzone:latest) when building the image. Else, we risk creating a `share/image-id.txt` file with multiple IDs in it, if we have another `dangerzone.rocks/dangerzone` image (with a different tag) in our dev environment. --- install/linux/build-image.sh | 8 +++++--- install/macos/build-image.sh | 8 +++++--- install/windows/build-image.py | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/install/linux/build-image.sh b/install/linux/build-image.sh index ce11758..210313d 100755 --- a/install/linux/build-image.sh +++ b/install/linux/build-image.sh @@ -2,11 +2,13 @@ set -e +TAG=dangerzone.rocks/dangerzone:latest + echo "Building container image" -podman build container --tag dangerzone.rocks/dangerzone +podman build container --tag $TAG echo "Saving and compressing container image" -podman save dangerzone.rocks/dangerzone | gzip > share/container.tar.gz +podman save $TAG | gzip > share/container.tar.gz echo "Looking up the image id" -podman image ls dangerzone.rocks/dangerzone | grep "dangerzone.rocks/dangerzone" | tr -s ' ' | cut -d' ' -f3 > share/image-id.txt +podman images --filter=reference=$TAG > share/image-id.txt diff --git a/install/macos/build-image.sh b/install/macos/build-image.sh index 1fdfe80..c30e6d5 100755 --- a/install/macos/build-image.sh +++ b/install/macos/build-image.sh @@ -2,11 +2,13 @@ set -e +TAG=dangerzone.rocks/dangerzone:latest + echo "Building container image" -docker build container --tag dangerzone.rocks/dangerzone +docker build container --tag $TAG echo "Saving and compressing container image" -docker save dangerzone.rocks/dangerzone | gzip > share/container.tar.gz +docker save $TAG | gzip > share/container.tar.gz echo "Looking up the image id" -docker image ls dangerzone.rocks/dangerzone | grep "dangerzone.rocks/dangerzone" | tr -s ' ' | cut -d' ' -f3 > share/image-id.txt +docker images --filter=reference=$TAG > share/image-id.txt diff --git a/install/windows/build-image.py b/install/windows/build-image.py index 4b06ce6..cf1d578 100644 --- a/install/windows/build-image.py +++ b/install/windows/build-image.py @@ -11,7 +11,7 @@ def main(): "build", "container", "--tag", - "dangerzone.rocks/dangerzone", + "dangerzone.rocks/dangerzone:latest", ] ) @@ -20,7 +20,7 @@ def main(): [ "docker", "save", - "dangerzone.rocks/dangerzone", + "dangerzone.rocks/dangerzone:latest", ], stdout=subprocess.PIPE, ) @@ -45,7 +45,7 @@ def main(): "list", "--format", "{{.ID}}", - "dangerzone.rocks/dangerzone", + "dangerzone.rocks/dangerzone:latest", ], text=True, )