Skip to content

Commit

Permalink
Trying different syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrdrew committed Nov 7, 2023
1 parent d82cd08 commit d3defd0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY controllers/ controllers/
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o manager main.go

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1037
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1072.1697626218
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65534:65534
Expand Down
1 change: 0 additions & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Build the manager binary
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.13-2.1698062273 as builder


WORKDIR /workspace

COPY go.mod go.mod
Expand Down
11 changes: 4 additions & 7 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mkdir -p "$DOCKER_CONF"
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" login -u="$RH_REGISTRY_USER" -p="$RH_REGISTRY_TOKEN" registry.redhat.io


### Start base image build and push
BASE_TAG=`cat go.mod go.sum Dockerfile.base | sha256sum | head -c 8`
BASE_IMG=quay.io/cloudservices/frontend-operator-build-base:$BASE_TAG
Expand All @@ -33,11 +32,9 @@ echo "received HTTP response: $RESPONSE"
# find all non-expired tags
VALID_TAGS_LENGTH=$(echo $RESPONSE | jq '[ .tags[] | select(.end_ts == null) ] | length')

docker buildx use multiarchbuilder

if [[ "$VALID_TAGS_LENGTH" -eq 0 ]]; then
docker --config="$DOCKER_CONF" buildx build --platform linux/amd64 -f Dockerfile.base --push . -t "${BASE_IMG}-amd64"
docker --config="$DOCKER_CONF" buildx build --platform linux/arm64 -f Dockerfile.base --push . -t "${BASE_IMG}-arm64"
docker --config="$DOCKER_CONF" buildx --builder multiarchbuilder build --platform linux/amd64 -f Dockerfile.base -t "${BASE_IMG}-amd64" --push .
docker --config="$DOCKER_CONF" buildx --builder multiarchbuilder build --platform linux/arm64 -f Dockerfile.base -t "${BASE_IMG}-arm64" --push .
docker --config="$DOCKER_CONF" manifest create "${BASE_IMG}" \
"${BASE_IMG}-amd64" \
"${BASE_IMG}-arm64"
Expand All @@ -46,8 +43,8 @@ fi
#### End


docker --config="$DOCKER_CONF" buildx build --platform linux/amd64 --build-arg BASE_IMAGE="$BASE_IMG" --build-arg GOARCH="amd64" -t "${IMAGE}:${IMAGE_TAG}-amd64" --push .
docker --config="$DOCKER_CONF" buildx build --platform linux/arm64 --build-arg BASE_IMAGE="$BASE_IMG" --build-arg GOARCH="arm64" -t "${IMAGE}:${IMAGE_TAG}-arm64" --push .
docker --config="$DOCKER_CONF" buildx --builder multiarchbuilder build --platform linux/amd64 --build-arg BASE_IMAGE="$BASE_IMG" --build-arg GOARCH="amd64" -t "${IMAGE}:${IMAGE_TAG}-amd64" --push .
docker --config="$DOCKER_CONF" buildx --builder multiarchbuilder build --platform linux/arm64 --build-arg BASE_IMAGE="$BASE_IMG" --build-arg GOARCH="arm64" -t "${IMAGE}:${IMAGE_TAG}-arm64" --push .

docker --config="$DOCKER_CONF" manifest create "${IMAGE}:${IMAGE_TAG}" \
"${IMAGE}:${IMAGE_TAG}-amd64" \
Expand Down

0 comments on commit d3defd0

Please sign in to comment.