chore: support building ARM image in docker makefile

This commit is contained in:
Marcus Holland-Moritz 2024-01-21 10:55:05 +01:00
parent 4c52178626
commit 0967b9bdf8

View File

@ -1,10 +1,14 @@
IMAGE="dwarfs-buildenv" IMAGE="dwarfs-buildenv"
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NPROC:=$(shell nproc)
build: build:
docker build -t $(IMAGE) . docker build -t $(IMAGE) .
build_arm:
docker build -t $(IMAGE) --build-arg ARCH=arm64v8 .
run: run:
@docker run -it --rm \ @docker run -it --rm \
--cap-add SYS_ADMIN --device /dev/fuse --privileged \ --cap-add SYS_ADMIN --device /dev/fuse --privileged \
@ -12,5 +16,5 @@ run:
--mount type=bind,source="$(ROOT_DIR)"/../@docker-ccache,target=/ccache \ --mount type=bind,source="$(ROOT_DIR)"/../@docker-ccache,target=/ccache \
--mount type=bind,source="$(ROOT_DIR)"/../@docker-home,target=/home/ubuntu \ --mount type=bind,source="$(ROOT_DIR)"/../@docker-home,target=/home/ubuntu \
--mount type=bind,source="$(ROOT_DIR)"/../@docker-build,target=/home/ubuntu/build \ --mount type=bind,source="$(ROOT_DIR)"/../@docker-build,target=/home/ubuntu/build \
--env CCACHE_DIR=/ccache --env CTEST_PARALLEL_LEVEL=$(nproc) \ --env CCACHE_DIR=/ccache --env CTEST_PARALLEL_LEVEL=$(NPROC) \
--entrypoint /bin/bash $(IMAGE) --entrypoint /bin/bash $(IMAGE)