Skip to content

Commit

Permalink
scripts/reproduce-container.sh: Avoid invoking the target container
Browse files Browse the repository at this point in the history
If the host does not have qemu-user installed, calling the container
fails for non-matching architectures. Avoid that by using image inspect
to obtain the value of DEBIAN_BASE_IMAGE_TAG.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Dec 8, 2024
1 parent 6a4a8d8 commit d38dc0c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/reproduce-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ if [ -n "$ARCH" ]; then
fi

# shellcheck disable=SC2086
DEBIAN_TAG=$(docker run --entrypoint "" --rm -t $PLATFORM_OPT \
"ghcr.io/siemens/kas/$TARGET:$TAG" \
sh -c 'printf "%b" $DEBIAN_BASE_IMAGE_TAG')
docker pull $PLATFORM_OPT "ghcr.io/siemens/kas/$TARGET:$TAG"
DEBIAN_TAG=$(docker image inspect --format '{{json .Config.Env}}' \
"ghcr.io/siemens/kas/$TARGET:$TAG" |
sed 's/.*DEBIAN_BASE_IMAGE_TAG=\([^"]\+\).*/\1/')
if [ -z "$DEBIAN_TAG" ]; then
echo "Cannot determine base image of ghcr.io/siemens/kas/$TARGET:$TAG"
exit 1
Expand Down

0 comments on commit d38dc0c

Please # to comment.