From f74a77d80b02fc56f2d4ff4d9dca5dea4ceea24c Mon Sep 17 00:00:00 2001 From: John Naulty Date: Mon, 6 Jan 2020 01:55:47 -0800 Subject: [PATCH] Use current user at build container runtime Using the current user id and group removes the need to use `sudo` when cleaning up build artifacts from the docker build stage. Issue: #355 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9259be7..57cfc6c 100644 --- a/Makefile +++ b/Makefile @@ -100,9 +100,10 @@ uncached-docker-build-toolchain: docker tag $(DOCKER_TOOLCHAIN_IMAGE):latest $(DOCKER_TOOLCHAIN_IMAGE):${SOLO_VERSION_MAJ} docker tag $(DOCKER_TOOLCHAIN_IMAGE):latest $(DOCKER_TOOLCHAIN_IMAGE):${SOLO_VERSION_MAJ}.${SOLO_VERSION_MIN} -docker-build-all: +docker-build-all: docker run --rm -v "$(CURDIR)/builds:/builds" \ -v "$(CURDIR):/solo" \ + -u $(shell id -u ${USER}):$(shell id -g ${USER}) \ $(DOCKER_TOOLCHAIN_IMAGE) "solo/in-docker-build.sh" ${SOLO_VERSION_FULL} CPPCHECK_FLAGS=--quiet --error-exitcode=2