Docker: Allow docker-build-full to work for BSD and GNU based systems (#65216)

* Replace tmp folder for tar stdin on build-docker-full

* Fix building linux/arm64 images using the Dockerfile
   Introduces JS_PLATFORM variable with linux/amd64 as default to allow building node packages.

* Revert unintended white line changes on Dockerfile
This commit is contained in:
Guilherme Caulada 2023-03-23 12:03:25 -03:00 committed by GitHub
parent 409bd33a8f
commit ac03c0efed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -2,12 +2,13 @@
ARG BASE_IMAGE=alpine:3.17
ARG JS_IMAGE=node:18-alpine3.17
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.20.1-alpine3.17
ARG GO_SRC=go-builder
ARG JS_SRC=js-builder
FROM ${JS_IMAGE} as js-builder
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} as js-builder
ENV NODE_OPTIONS=--max_old_space_size=8000

View File

@ -165,15 +165,13 @@ shellcheck: $(SH_FILES) ## Run checks for shell scripts.
##@ Docker
TMP_DIR!=mktemp -d
TAG_SUFFIX=$(if $(WIRE_TAGS)!=oss,-$(WIRE_TAGS))
PLATFORM=linux/amd64
build-docker-full: ## Build Docker image for development.
@echo "build docker container"
cp -Lrf . $(TMP_DIR)
DOCKER_BUILDKIT=1 \
docker build $(TMP_DIR) \
tar -ch . | \
docker buildx build - \
--platform $(PLATFORM) \
--build-arg BINGO=false \
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
@ -183,9 +181,8 @@ build-docker-full: ## Build Docker image for development.
build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
@echo "build docker container"
cp -Lrf . $(TMP_DIR)
DOCKER_BUILDKIT=1 \
docker build $(TMP_DIR) \
tar -ch . | \
docker buildx build - \
--platform $(PLATFORM) \
--build-arg BINGO=false \
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \