Allow the uid and gid to be customizeable
Change-Id: Ib6fd0da0020ec71a9d70d96501b40e849c004531
This commit is contained in:
parent
aeff89ce24
commit
c51f595ee8
@ -12,6 +12,9 @@ ARG PIP_PACKAGES=""
|
||||
ARG PLUGIN=no
|
||||
ARG PYTHON3=no
|
||||
|
||||
ARG UID=42424
|
||||
ARG GID=42424
|
||||
|
||||
COPY scripts /opt/loci/scripts
|
||||
COPY bindep.txt /opt/loci/
|
||||
|
||||
|
@ -60,6 +60,8 @@ For more advanced building you can use docker build arguments to define:
|
||||
should contain
|
||||
* `PROJECT_REF` The git ref, branch, or tag the container should fetch for
|
||||
the project
|
||||
* `UID` The uid of the user that will be created (defaults to 42424).
|
||||
* `GID` The gid of the group that will be created (default to 42424).
|
||||
* `WHEELS` The location of the wheels tarball. This accepts a url to a
|
||||
tarball or a Docker image name in the form of
|
||||
[myregistry/]mydockernamespace/requirements[:ubuntu]
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
set -ex
|
||||
|
||||
groupadd -g 42424 ${PROJECT}
|
||||
useradd -u 42424 -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT}
|
||||
groupadd -g ${GID} ${PROJECT}
|
||||
useradd -u ${UID} -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT}
|
||||
|
||||
mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT}
|
||||
chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT}
|
||||
|
Loading…
x
Reference in New Issue
Block a user