Skip to content

Commit

Permalink
chore: build multi-arch images for test
Browse files Browse the repository at this point in the history
  • Loading branch information
adoyle-h committed Dec 14, 2022
1 parent 37c38fe commit bcde7db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
13 changes: 12 additions & 1 deletion tools/build-test-image
Expand Up @@ -8,12 +8,21 @@ set -o errtrace

SCRIPT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
readonly SCRIPT_DIR
BUILDER=lobash-test-builder

if ! docker buildx inspect $BUILDER &>/dev/null; then
docker buildx create --name $BUILDER --driver docker-container --bootstrap
fi

docker buildx use $BUILDER

main() {
local version="${BASHVER:-4.4}"

local docker_args=(
-t "lobash/test-bash:$version"
--platform 'linux/amd64,linux/arm64'
--push
--build-arg "VERSION=$version"
)

Expand All @@ -24,7 +33,9 @@ main() {
)
fi

docker build "$@" "${docker_args[@]}" - < "$SCRIPT_DIR"/test.dockerfile
echo "[TODO] docker buildx build $* ${docker_args[*]} - < $SCRIPT_DIR/test.dockerfile"

docker buildx build "$@" "${docker_args[@]}" - < "$SCRIPT_DIR"/test.dockerfile
}

main "$@"
3 changes: 1 addition & 2 deletions tools/build-test-images
Expand Up @@ -14,8 +14,7 @@ source "$SCRIPT_DIR/test-image-versions"

main() {
for version in "${TEST_IMAGE_VERIONS[@]}"; do
echo "IN_CHINA=${IN_CHINA:-} BASHVER=$version $SCRIPT_DIR/build-test-image"
IN_CHINA=${IN_CHINA:-} BASHVER=$version "$SCRIPT_DIR/build-test-image"
IN_CHINA=${IN_CHINA:-} BASHVER=$version "$SCRIPT_DIR/build-test-image" "$@"
done
}

Expand Down
4 changes: 2 additions & 2 deletions tools/push-test-images
Expand Up @@ -14,8 +14,8 @@ source "$SCRIPT_DIR/test-image-versions"

main() {
for version in "${TEST_IMAGE_VERIONS[@]}"; do
echo "docker push lobash/test-bash:${version}"
docker push lobash/test-bash:"${version}"
echo "[TODO] docker push $* lobash/test-bash:${version}"
docker push "$@" lobash/test-bash:"${version}"
done
}

Expand Down

0 comments on commit bcde7db

Please sign in to comment.