diff contrib/packaging/dockerdeb @ 38457:11eda1f1b6e7

packaging: consistently create build user in Dockerfiles Previously, dockerlib.sh appended some commands to create a "build" user in each Docker image. The resulting Docker images could be inconsistent depending on the execution environment and base image. With this change, we explicitly create our custom user and group as the first action in each Dockerfile. The user always has user:group 1000:1000 and all built images are consistent. We also create a home directory for the user under /build. This directory is currently ignored. As part of this, we stop setting the DBUILDUSER variable in dockerlib.sh and instead set it in the respective scripts that call it. This is in preparation for further refactoring of dockerlib.sh. Differential Revision: https://phab.mercurial-scm.org/D3758
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 12 May 2018 15:51:37 -0700
parents 917f635b5c6a
children e5916f1236f3
line wrap: on
line diff
--- a/contrib/packaging/dockerdeb	Fri Jun 15 00:50:48 2018 +0530
+++ b/contrib/packaging/dockerdeb	Sat May 12 15:51:37 2018 -0700
@@ -22,6 +22,8 @@
 # container and hope it's writable. Whee.
 dn=$(basename $ROOTDIR)
 
+DBUILDUSER=build
+
 if [ $(uname) = "Darwin" ] ; then
     $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
             sh -c "cd /mnt/$dn && make clean && make local"