File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,20 @@ docker-build: ## Build the operator docker image.
156156docker-push : # # Push the operator docker image.
157157 docker push ${IMG}
158158
159+ # PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
160+ # architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
161+ # - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
162+ # - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
163+ # - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
164+ # To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
165+ PLATFORMS ?= linux/arm64,linux/amd64
166+ .PHONY : docker-buildx
167+ docker-buildx : # # Build and push docker image for the manager for cross-platform support
168+ - docker buildx create --name koperator-builder
169+ docker buildx use koperator-builder
170+ docker buildx build --push --platform=$(PLATFORMS ) --tag ${IMG} -f Dockerfile .
171+ - docker buildx rm koperator-builder
172+
159173bin/controller-gen : bin/controller-gen-$(CONTROLLER_GEN_VERSION ) # # Symlink controller-gen-<version> into versionless controller-gen.
160174 @ln -sf controller-gen-$(CONTROLLER_GEN_VERSION ) bin/controller-gen
161175
You can’t perform that action at this time.
0 commit comments