You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The approach taken here extends the existing support for
cross-compiling binaries on the build host and specifying the Go
compiler: Go is installed if needed (as in Prow testing), binaries are
build on the host, then one image is created for each platform, and
finally those are combined into a single multi-architecture image.
Copy file name to clipboardExpand all lines: build.make
+63
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,69 @@ build: $(CMDS:%=build-%)
105
105
container: $(CMDS:%=container-%)
106
106
push: $(CMDS:%=push-%)
107
107
108
+
# Additional parameters are needed when pushing to a local registry,
109
+
# see https://github.com/docker/buildx/issues/94.
110
+
# However, that then runs into https://github.com/docker/cli/issues/2396.
111
+
#
112
+
# What works for local testing is:
113
+
# make push-multiarch PULL_BASE_REF=master REGISTRY_NAME=<your account on dockerhub.io> BUILD_PLATFORMS="linux amd64; windows amd64 .exe; linux ppc64le -ppc64le; linux s390x -s390x"
114
+
DOCKER_BUILDX_CREATE_ARGS ?=
115
+
116
+
# This target builds a multiarch image for one command using Moby BuildKit builder toolkit.
117
+
# Docker Buildx is included in Docker 19.03.
118
+
#
119
+
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
120
+
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
121
+
# PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
0 commit comments