Skip to content

Commit

Permalink
feat(ci): publish arm64 architecture
Browse files Browse the repository at this point in the history
Ref #4148
  • Loading branch information
squakez committed May 25, 2023
1 parent 230343c commit 58176ab
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -437,32 +437,23 @@ ifneq (,$(findstring SNAPSHOT,$(RUNTIME_VERSION)))
endif
@echo "####### Building Camel K operator container image..."
mkdir -p build/_maven_output
docker build -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION) -f build/Dockerfile .

images-arch: build kamel-overlay maven-overlay bundle-kamelets
ifneq (,$(findstring SNAPSHOT,$(RUNTIME_VERSION)))
./script/package_maven_artifacts.sh -s "$(STAGING_RUNTIME_REPO)" -d "$(CAMEL_K_RUNTIME_DIR)" $(RUNTIME_VERSION)
endif
@echo "####### Building Camel K operator container image for multi architectures..."
mkdir -p build/_maven_output
docker buildx rm --all-inactive --force
docker buildx create --append --name builder
ifeq ($(shell uname -m), x86_x64)
docker buildx build --platform=linux/amd64 -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION) -f build/Dockerfile.arch .
endif
ifeq ($(shell uname -m), aarch64)
docker buildx build --platform=linux/arm64 -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION) -f build/Dockerfile.arch .
endif
ifeq ($(shell uname -m), arm64)
docker buildx build --platform=linux/amd64 -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION) -f build/Dockerfile.arch .
endif
docker build --platform=linux/amd64 -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION) -f build/Dockerfile .
docker build --platform=linux/arm64 -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 -f build/Dockerfile .

images-push:
docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)
docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64

images-push-staging:
docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION) $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)
docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-arm64
docker push $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)
docker push $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-arm64
# TODO: we can evaluate the usage of manifest and try the following
# docker manifest create $(CUSTOM_IMAGE):$(CUSTOM_VERSION) \
# --amend $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64 \
# --amend $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64
# docker manifest push --purge $(CUSTOM_IMAGE):$(CUSTOM_VERSION)

get-image:
@echo $(CUSTOM_IMAGE)
Expand Down

0 comments on commit 58176ab

Please sign in to comment.