Skip to content

Commit

Permalink
Merge pull request #140 from RedHatInsights/arm_builds
Browse files Browse the repository at this point in the history
Build arm64 and amd64 versions and use multi-arch manifest on quay.
  • Loading branch information
adamrdrew authored Sep 25, 2023
2 parents 687d8e7 + 7cc6d4a commit 9490d1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY api/ api/
COPY controllers/ controllers/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux go build -o manager main.go

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1037
WORKDIR /
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY controllers/ controllers/

USER 0

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux go build -o manager main.go

RUN rm main.go
RUN rm -rf api
Expand Down
10 changes: 8 additions & 2 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ if [[ "$VALID_TAGS_LENGTH" -eq 0 ]]; then
fi
#### End

docker --config="$DOCKER_CONF" build --build-arg BASE_IMAGE="$BASE_IMG" -t "${IMAGE}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" push "${IMAGE}:${IMAGE_TAG}"
docker --config="$DOCKER_CONF" build --platform linux/amd64 --build-arg BASE_IMAGE="$BASE_IMG" --build-arg GOARCH="amd64" -t "${IMAGE}:${IMAGE_TAG}-amd64" --push .
docker --config="$DOCKER_CONF" 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" \
"${IMAGE}:${IMAGE_TAG}-arm64"

docker --config="$DOCKER_CONF" manifest push "${IMAGE}:${IMAGE_TAG}"

0 comments on commit 9490d1c

Please sign in to comment.