From 42249ede0bb39d5117ce3e185caf8893f15fe367 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Thu, 30 Jun 2022 15:11:10 +0000 Subject: [PATCH] Set SELinux labels on host FS when building via docker/podman Adds :z to the bind mount, ensuring the container can access the files when SELinux is enabled. Signed-off-by: Gabriel Adrian Samfira --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e6ef9ad2..8df31f61 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,11 @@ SHELL := bash IMAGE_TAG = garm-build -USER_ID=$(shell (docker --version | grep -q podman) && echo "0" || shell id -u) -USER_GROUP=$(shell (docker --version | grep -q podman) && echo "0" || shell id -g) +USER_ID=$(shell ((docker --version | grep -q podman) && echo "0" || id -u)) +USER_GROUP=$(shell ((docker --version | grep -q podman) && echo "0" || id -g)) build-static: @echo Building garm docker build --tag $(IMAGE_TAG) . - docker run --rm -e USER_ID=$(USER_ID) -e USER_GROUP=$(USER_GROUP) -v $(PWD):/build/garm $(IMAGE_TAG) /build-static.sh + docker run --rm -e USER_ID=$(USER_ID) -e USER_GROUP=$(USER_GROUP) -v $(PWD):/build/garm:z $(IMAGE_TAG) /build-static.sh @echo Binaries are available in $(PWD)/bin