Skip to content

Commit

Permalink
fixup! Docker: run build commands as regular user
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjoern Doebel committed Aug 28, 2020
1 parent 75004e6 commit 626b108
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,17 @@ style:

DOCKERFILE := $(shell find $(ROOT) -type f -name Dockerfile)
DOCKERIMAGE := "ktf:build"
ifeq ($(SYSTEM), LINUX)
DOCKER_BUILD_ARGS=--build-arg USER_ID=$$(id -u) --build-arg GROUP_ID=$$(id -g) --build-arg USER=$$USER
else
DOCKER_BUILD_ARGS=--build-arg USER_ID=1024 --build-arg GROUP_ID=1024 --build-arg USER=$$USER
endif

.PHONY: dockerimage
dockerimage:
@echo "Creating docker image"
@ docker build -t $(DOCKERIMAGE) -f $(DOCKERFILE) \
--build-arg USER_ID=$$(id -u) \
--build-arg GROUP_ID=$$(id -g) \
--build-arg USER=$$USER \
.
$(DOCKER_BUILD_ARGS) .

.PHONY: docker%
docker%: dockerimage
Expand Down

0 comments on commit 626b108

Please sign in to comment.