docker: Don't mount ccache db if NOUSER=1
PATCH 1/1 docker: Don't mount ccache db if NOUSER=1
With NOUSER=1 the container runs code as root, which may create privileged files that will not be be accssible next time. Skip ccache dir mount in this case.
Signed-off-by Fam Zheng <[email protected]>
--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/docker/Makefile.include +4 -2
@@ -143,9 +143,11 @@ docker-run: docker-qemu-src -e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \ -e V=$V -e J=$J -e DEBUG=$(DEBUG) \ -e SHOW_ENV=$(SHOW_ENV) \ - -e CCACHE_DIR=/var/tmp/ccache \ + $(if $(NOUSER),, \ + -e CCACHE_DIR=/var/tmp/ccache \ + -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ + ) \ -v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \ - -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ $(IMAGE) \ /var/tmp/qemu/run \ $(TEST), " RUN $(TEST) in ${IMAGE}")
Signature · 1 line
2.13.5
Quoted 5 lines · Fam Zheng
With NOUSER=1 the container runs code as root, which may create privileged files that will not be be accssible next time. Skip ccache dir mount in this case.
Signed-off-by Fam Zheng <[email protected]>
Quoted 25 lines
--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/docker/Makefile.include +4
-3@@ -143,9 +143,11 @@ docker-run: docker-qemu-src -e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \ -e V=$V -e J=$J -e DEBUG=$(DEBUG) \ -e SHOW_ENV=$(SHOW_ENV) \ - -e CCACHE_DIR=/var/tmp/ccache \ + $(if $(NOUSER),, \ + -e CCACHE_DIR=/var/tmp/ccache \ + -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ + ) \ -v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \ - -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ $(IMAGE) \ /var/tmp/qemu/run \ $(TEST), " RUN $(TEST) in ${IMAGE}") --2.13.5
Fam Zheng
AppliedQuoted 8 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Fam Zheng
With NOUSER=1 the container runs code as root, which may create privileged files that will not be be accssible next time. Skip ccache dir mount in this case.
Signed-off-by Fam Zheng <[email protected]>
Queued, thanks.
Fam
Alex Bennée
Reviewed-byQuoted 8 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Fam Zheng
With NOUSER=1 the container runs code as root, which may create privileged files that will not be be accssible next time. Skip ccache dir mount in this case.
Signed-off-by Fam Zheng <[email protected]>
Makes sense:
Reviewed-by Alex Bennée <[email protected]>
Quoted 18 lines
Quoted 18 lines
--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/docker/Makefile.include +4
-1@@ -143,9 +143,11 @@ docker-run: docker-qemu-src -e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \ -e V=$V -e J=$J -e DEBUG=$(DEBUG) \ -e SHOW_ENV=$(SHOW_ENV) \ - -e CCACHE_DIR=/var/tmp/ccache \ + $(if $(NOUSER),, \ + -e CCACHE_DIR=/var/tmp/ccache \ + -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ + ) \
Quoted 8 lines
Quoted 8 lines
tests/docker/Makefile.include +0
-2-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \ - -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ $(IMAGE) \ /var/tmp/qemu/run \ $(TEST), " RUN $(TEST) in ${IMAGE}") --2.13.5
--
Alex Bennée