Add .docker/Makefile for interactive testing

This commit is contained in:
Marcus Holland-Moritz 2023-07-17 11:17:49 +02:00
parent 99f511564d
commit 89505ef084

15
.docker/Makefile Normal file
View File

@ -0,0 +1,15 @@
IMAGE="dwarfs-buildenv"
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
build:
docker build -t $(IMAGE) .
run:
@docker run -it --rm \
--cap-add SYS_ADMIN --device /dev/fuse --privileged \
--mount type=bind,source="$(ROOT_DIR)"/..,target=/workspace,readonly \
--mount type=bind,source="$(ROOT_DIR)"/../@docker-ccache,target=/ccache \
--mount type=bind,source="$(ROOT_DIR)"/../@docker-build,target=/home/mhx/build \
--env CCACHE_DIR=/ccache --env CTEST_PARALLEL_LEVEL=$(nproc) \
--entrypoint /bin/bash $(IMAGE)