Skip to content

Commit

Permalink
Refactor update
Browse files Browse the repository at this point in the history
Change the names of base image and debug image to stable local
names and update build-crossdock.sh

Signed-off-by: Kun-Lu <kun.lu@ibm.com>
  • Loading branch information
kun-lu20 committed Jun 14, 2021
1 parent 027376a commit 5a6b268
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
VERSION := 1.0.0
ROOT_IMAGE ?= alpine:3.13
CERT_IMAGE := alpine:3.13
CERT_IMAGE := $(ROOT_IMAGE)
GOLANG_IMAGE := golang:1.15-alpine

BASE_IMAGE := localhost:5000/baseimg:$(VERSION)-$(shell echo $(ROOT_IMAGE) | tr : -)
DEBUG_IMAGE := localhost:5000/debugimg:$(VERSION)-$(shell echo $(GOLANG_IMAGE) | tr : -)
BASE_IMAGE := localhost:5000/baseimg_alpine:latest
DEBUG_IMAGE := localhost:5000/debugimg_alpine:latest
PLATFORMS := linux/amd64,linux/s390x

create-baseimg-debugimg: create-baseimg create-debugimg
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-all-in-one-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ make build-all-in-one GOOS=linux GOARCH=amd64
make build-all-in-one GOOS=linux GOARCH=s390x
platforms="linux/amd64,linux/s390x"
repo=jaegertracing/all-in-one
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg:1.0.0-alpine-3.13 --build-arg debug_image=golang:1.15-alpine "
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg_alpine:latest --build-arg debug_image=golang:1.15-alpine "
#build all-in-one image locally for integration test
bash scripts/build-upload-a-docker-image.sh -l -c all-in-one -b "${base_debug_img_arg}" -d cmd/all-in-one -p "${platforms}" -t release
run_integration_test localhost:5000/$repo
Expand All @@ -50,7 +50,7 @@ bash scripts/build-upload-a-docker-image.sh -c all-in-one -b "${base_debug_img_a

make build-all-in-one-debug GOOS=linux GOARCH=$GOARCH
repo=${repo}-debug
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg:1.0.0-alpine-3.13 --build-arg debug_image=localhost:5000/debugimg:1.0.0-golang-1.15-alpine "
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg_alpine:latest --build-arg debug_image=localhost:5000/debugimg_alpine:latest "
#build all-in-one-debug image locally for integration test
bash scripts/build-upload-a-docker-image.sh -l -c all-in-one-debug -b "${base_debug_img_arg}" -d cmd/all-in-one -t debug
run_integration_test localhost:5000/$repo
Expand Down
5 changes: 1 addition & 4 deletions scripts/build-crossdock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ make build-and-run-crossdock
# Only push images to dockerhub/quay.io for master branch
if [[ "$BRANCH" == "master" ]]; then
echo 'upload images to dockerhub/quay.io'
make build-crossdock-binary GOOS=linux GOARCH=amd64
make build-crossdock-binary GOOS=linux GOARCH=s390x
PLATFORMS="linux/amd64,linux/s390x"
REPO=jaegertracing/test-driver
IMAGE_TAGS=$(bash scripts/compute-tags.sh $REPO)
IMAGE_TAGS="${IMAGE_TAGS} --tag docker.io/${REPO}:${COMMIT} --tag quay.io/${REPO}:${COMMIT}"
bash scripts/docker-login.sh
docker buildx build --push \
--progress=plain \
--platform=$PLATFORMS \
--platform=linux/amd64 \
${IMAGE_TAGS} \
crossdock/
else
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-upload-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ make build-binaries-linux
make build-binaries-s390x

platforms="linux/amd64,linux/s390x"
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg:1.0.0-alpine-3.13 --build-arg debug_image=golang:1.15-alpine "
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg_alpine:latest --build-arg debug_image=golang:1.15-alpine "

# build/upload images for release version of Jaeger backend components
for component in agent collector query ingester
Expand All @@ -30,7 +30,7 @@ done

# build amd64 docker images
platforms="linux/amd64"
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg:1.0.0-alpine-3.13 --build-arg debug_image=localhost:5000/debugimg:1.0.0-golang-1.15-alpine "
base_debug_img_arg="--build-arg base_image=localhost:5000/baseimg_alpine:latest --build-arg debug_image=localhost:5000/debugimg_alpine:latest "

# build/upload images for debug version of Jaeger backend components
for component in agent collector query ingester
Expand Down
4 changes: 3 additions & 1 deletion scripts/compute-tags.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

# Compute major/minor/etc image tags based on the current branch

set -exu

# Compute the tag
BASE_BUILD_IMAGE=$1
BRANCH=${BRANCH:?'expecting BRANCH env var'}

## if we are on a release tag, let's extract the version number
## the other possible value, currently, is 'master' (or another branch name)
Expand Down

0 comments on commit 5a6b268

Please sign in to comment.