garm/Makefile
Gabriel Adrian Samfira 42249ede0b 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 <gsamfira@cloudbasesolutions.com>
2022-06-30 15:11:10 +00:00

14 lines
453 B
Makefile

SHELL := bash
.PHONY : build-static
IMAGE_TAG = garm-build
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:z $(IMAGE_TAG) /build-static.sh
@echo Binaries are available in $(PWD)/bin