File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,21 @@ container-image: ## Build a container image for the preview of the website
74
74
container-push : container-image # # Push container image for the preview of the website
75
75
$(CONTAINER_ENGINE ) push $(CONTAINER_IMAGE )
76
76
77
+ PLATFORMS ?= linux/arm64,linux/amd64
78
+ docker-push : # # Build a multi-architecture image and push that into the registry
79
+ docker run --rm --privileged tonistiigi/binfmt:qemu-v6.2.0-26@sha256:5bf63a53ad6222538112b5ced0f1afb8509132773ea6dd3991a197464962854e --install all
80
+ docker buildx create --use --name=image-builder 2> /dev/null || docker buildx use --default image-builder
81
+ # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
82
+ sed -e ' 1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
83
+ docker buildx build \
84
+ --push \
85
+ --platform=$(PLATFORMS ) \
86
+ --build-arg HUGO_VERSION=$(HUGO_VERSION ) \
87
+ --tag $(CONTAINER_IMAGE ) \
88
+ -f Dockerfile.cross .
89
+ docker buildx stop image-builder
90
+ rm Dockerfile.cross
91
+
77
92
container-build : module-check
78
93
$(CONTAINER_RUN ) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE ) sh -c " npm ci && hugo --minify --environment development"
79
94
Original file line number Diff line number Diff line change 18
18
- -c
19
19
- |
20
20
gcloud auth configure-docker \
21
- && make container -push
21
+ && make docker -push
22
22
substitutions :
23
23
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
24
24
# can be used as a substitution
You can’t perform that action at this time.
0 commit comments