Skip to content

Commit

Permalink
Execute docker with user and group ids
Browse files Browse the repository at this point in the history
  • Loading branch information
dgptha committed Nov 26, 2024
1 parent 023ec29 commit c1c72cb
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ VERSION ?= v0.0.0
REVMARK ?= Draft
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
ifneq ($(SKIP_DOCKER),true)
DOCKER_IS_PODMAN = \
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
ifeq "$(DOCKER_IS_PODMAN)" "1"
DOCKER_VOL_SUFFIX = :z
endif

DOCKER_CMD := \
docker run --rm \
-v ${PWD}:/build${DOCKER_VOL_SUFFIX} \
-w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
DOCKER_IS_PODMAN = \
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
ifeq "$(DOCKER_IS_PODMAN)" "1"
DOCKER_VOL_SUFFIX = :z
endif

DOCKER_CMD := \
docker run --rm \
-u `id -u`:`id -g` \
-v ${PWD}:/build${DOCKER_VOL_SUFFIX} \
-w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
endif

SRC_DIR := src
Expand Down

0 comments on commit c1c72cb

Please sign in to comment.