diff options
author | Runar Borge <runar@borge.nu> | 2019-01-09 13:26:32 +0100 |
---|---|---|
committer | Runar Borge <runar@borge.nu> | 2019-01-09 13:26:32 +0100 |
commit | ed03c43b2a0f7d6d072bab3ae116e1fa0c217375 (patch) | |
tree | fdc1fe0f280cb9548892357f76492346f71aa526 /Dockerfile | |
parent | 88c8b3440bd4e4a31ca86cd5d6e8d23bbc0684e7 (diff) | |
download | vyos-build-ed03c43b2a0f7d6d072bab3ae116e1fa0c217375.tar.gz vyos-build-ed03c43b2a0f7d6d072bab3ae116e1fa0c217375.zip |
Change user on docker image to the current owner of the volume directory (GOSU)
Insted of hardcoding the user used to build inside the container it will now be auto configured to be the user UID that owns the vyos-build directory
This is done with the gosu utillity and a entrypoint script
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -5,6 +5,7 @@ FROM debian:jessie RUN echo 'deb http://ftp.debian.org/debian jessie-backports main' | tee -a /etc/apt/sources.list &&\ apt-get update && apt-get install -y \ + gosu \ vim \ git \ make \ @@ -143,10 +144,12 @@ RUN export LATEST="$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packe curl -K- | gzip -d > /usr/bin/packer && \ chmod +x /usr/bin/packer +COPY scripts/docker-entrypoint.sh /usr/local/bin/ # Create vyos_bld user account and enable sudo -RUN useradd -ms /bin/bash -u 1006 --gid users vyos_bld && \ - usermod -aG sudo vyos_bld && \ - echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +#RUN useradd -ms /bin/bash -u 1006 --gid users vyos_bld && \ +# usermod -aG sudo vyos_bld && \ +# echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers -USER vyos_bld -WORKDIR /home/vyos_bld +#USER vyos_bld +#WORKDIR /home/vyos_bld +ENTRYPOINT ["docker-entrypoint.sh"] |