Skip to content

Commit e07c797

Browse files
authored
Run docker image as current user (#240)
1 parent a79c012 commit e07c797

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

validator/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ DOCKER_SHELLTEST_BUILD_ARGS :=-f ${ROOT_DIR}/Dockerfile --target shelltest -t sh
1010
EXAMPLE_FILES := $(shell find ${ROOT_DIR}/../examples -name "*.yaml" -exec basename {} \; | sort)
1111
$(shell mkdir -p out)
1212

13+
# User to run as in docker images.
14+
DOCKER_USER=$(shell id -u):$(shell id -g)
15+
1316
GO = go
1417

1518
TOOLS = $(CURDIR)/.tools
@@ -49,7 +52,7 @@ validator-build-shelltest-image:
4952
docker build ${DOCKER_SHELLTEST_BUILD_ARGS} ${ROOT_DIR}
5053

5154
validator-run-shelltests: validator-build-shelltest-image
52-
docker run -v ${PARENT_DIR}:/root shelltest:${CURRENT_GIT_REF} -- --plain /root/validator/shelltests
55+
docker run -u $(DOCKER_USER) -v ${PARENT_DIR}:/root shelltest:${CURRENT_GIT_REF} -- --plain /root/validator/shelltests
5356

5457
.PHONY: govulncheck
5558
govulncheck: $(TOOLS)/govulncheck

0 commit comments

Comments
 (0)