Skip to content

Commit

Permalink
contrib: Better versioning when building the service image
Browse files Browse the repository at this point in the history
Pipe the output of the git archive command to docker build to include
the version context. It seemed better to stop using the makefile
rather than add this specific use-case.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
  • Loading branch information
crozzy committed Feb 23, 2023
1 parent d3655ee commit bb3a4be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/openshift/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -exv
REPOSITORY="quay.io/app-sre"
IMAGE="${REPOSITORY}/clair"

make container-build
git archive HEAD|
docker build -t clair-service:latest -

GIT_HASH=`git rev-parse --short=7 HEAD`
skopeo copy --dest-creds "${QUAY_USER}:${QUAY_TOKEN}" \
"docker-daemon:clair-local:latest" \
"docker-daemon:clair-service:latest" \
"docker://${IMAGE}:latest"

skopeo copy --dest-creds "${QUAY_USER}:${QUAY_TOKEN}" \
"docker-daemon:clair-local:latest" \
"docker-daemon:clair-service:latest" \
"docker://${IMAGE}:${GIT_HASH}"

0 comments on commit bb3a4be

Please sign in to comment.