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
multiarch: use normal Dockerfiles and build command
This removes code duplication:
- the same Go environment is used for multiarch and for testing
- BUILD_PLATFORMS determines what is getting build instead
of hard-coding that in the make target
- no separate Dockerfile.multiarch
We still need separate Dockerfiles for Linux and Windows because
Windows has special requirements.
Indention is changed to use tabs.
Copy file name to clipboardExpand all lines: Makefile
+47-23Lines changed: 47 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -19,38 +19,62 @@ all: build
19
19
20
20
include release-tools/build.make
21
21
22
-
# This target builds multiarch images using Moby BuildKit builder toolkit.
23
-
# Docker Buildx is included in Docker 19.03 and needs DOCKER_CLI_EXPERIMENTAL enabled to run corresponding commands.
24
-
# Currently amd, s390x and Windows manifest is pushed for canary, release branch and released tags.
25
-
# Images generated from Prow build are pushed to staging area on gcr
26
-
push-multiarch-%:
27
-
make BUILD_PLATFORMS="windows amd64 .exe"
22
+
# Additional parameters are needed when pushing to a local registry,
23
+
# see https://github.com/docker/buildx/issues/94.
24
+
# However, that then runs into https://github.com/docker/cli/issues/2396.
25
+
#
26
+
# What works for local testing is:
27
+
# 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"
28
+
DOCKER_BUILDX_CREATE_ARGS ?=
29
+
30
+
# This target builds a multiarch image for one command using Moby BuildKit builder toolkit.
31
+
# Docker Buildx is included in Docker 19.03.
32
+
#
33
+
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
34
+
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
35
+
# PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
36
+
# the tag for the resulting multiarch image.
37
+
push-multiarch-%: build-%
38
+
if! [ "$(PULL_BASE_REF)" ];then \
39
+
echo>&2"ERROR: PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name.";\
0 commit comments