mirror of
https://github.com/grafana/grafana.git
synced 2024-11-21 16:38:03 -06:00
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:
parent
409bd33a8f
commit
ac03c0efed
@ -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
|
||||
|
||||
|
11
Makefile
11
Makefile
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user