Skip to content

Commit

Permalink
Add version to nettest image
Browse files Browse the repository at this point in the history
Adds a `version` file to nettest image which can help determine version
in-use for submariner-metrics-proxy pods

Refer submariner-io/enhancements#204

Fixes submariner-io#1327

Signed-off-by: Vishal Thapar <[email protected]>
  • Loading branch information
vthapar authored and tpantelis committed Aug 8, 2023
1 parent c898dd1 commit 9135eda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions package/Dockerfile.nettest
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ FROM alpine

WORKDIR /app

ARG VERSION

RUN apk add --no-cache \
bash \
bind-tools \
Expand All @@ -27,4 +29,6 @@ RUN apk add --no-cache \
COPY --from=0 /usr/local/bin/net* /usr/local/bin/
COPY scripts/nettest/* /app/

RUN echo ${VERSION} >> /app/version

CMD ["/bin/bash","-l"]
2 changes: 1 addition & 1 deletion scripts/shared/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fi
[[ -n "$PLATFORM" ]] || PLATFORM="$default_platform"

# Rebuild the image to update any changed layers and tag it back so it will be used.
buildargs_flags=(--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg "BASE_BRANCH=${BASE_BRANCH}")
buildargs_flags=(--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg "BASE_BRANCH=${BASE_BRANCH}" --build-arg "VERSION=${VERSION}")
if [[ "${PLATFORM}" != "${default_platform}" ]] && docker buildx version > /dev/null 2>&1; then
docker buildx use buildx_builder || docker buildx create --name buildx_builder --use
docker buildx build "${output_flag}" -t "${local_image}" "${cache_flags[@]}" -f "${dockerfile}" --iidfile "${hashfile}" --platform "${PLATFORM}" "${buildargs_flags[@]}" .
Expand Down

0 comments on commit 9135eda

Please sign in to comment.