Skip to content

Commit

Permalink
[antithesis] Ensure references to pushed images are qualified (#3264)
Browse files Browse the repository at this point in the history
  • Loading branch information
marun authored Aug 3, 2024
1 parent 5f19677 commit 307c88e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/lib_build_antithesis_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,23 @@ function build_antithesis_images {
local docker_cmd="docker buildx build\
--build-arg GO_VERSION=${go_version}\
--build-arg BUILDER_IMAGE_TAG=${image_tag}\
--build-arg BUILDER_WORKDIR=${builder_workdir}\
--build-arg AVALANCHEGO_NODE_IMAGE=antithesis-avalanchego-node:${node_image_tag}"
--build-arg BUILDER_WORKDIR=${builder_workdir}"

# By default the node image is intended to be local-only.
AVALANCHEGO_NODE_IMAGE="antithesis-avalanchego-node:${node_image_tag}"

if [[ -n "${image_prefix}" && -z "${node_only}" ]]; then
# Push images with an image prefix since the prefix defines a registry location, and only if building
# all images. When building just the node image the image is only intended to be used locally.
docker_cmd="${docker_cmd} --push"

# When the node image is pushed as part of the build, references to the image must be qualified.
AVALANCHEGO_NODE_IMAGE="${image_prefix}/${AVALANCHEGO_NODE_IMAGE}"
fi

# Ensure the correct node image name is configured
docker_cmd="${docker_cmd} --build-arg AVALANCHEGO_NODE_IMAGE=${AVALANCHEGO_NODE_IMAGE}"

# Build node image first to allow the workload image to use it.
${docker_cmd} -t "${node_image_name}" -f "${node_dockerfile}" "${target_path}"

Expand Down

0 comments on commit 307c88e

Please sign in to comment.