diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-01-11 07:31:05 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-01-11 07:33:16 +0100 |
commit | 041bc80e71c3c700ff0c01702d9ffd0885d2b75b (patch) | |
tree | 5d8e7319a1dfa82da0bd194d70d888712f92360e /Dockerfile | |
parent | 988a099f98e5cfb1b15d8b2adb45277342ac0304 (diff) | |
download | vyos-build-041bc80e71c3c700ff0c01702d9ffd0885d2b75b.tar.gz vyos-build-041bc80e71c3c700ff0c01702d9ffd0885d2b75b.zip |
CI/CD: Improve 'goso' handling for Docker and Jenkins
* Inside the container user can call 'sudo' without password
* Added Docker environment variables to controll the 'gosu' UID/GID
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -123,7 +123,7 @@ RUN apt-get update && apt-get install -y \ liblua5.1-dev # Packages needed for vyos-frr -RUN sudo apt-get update && sudo apt-get install -y \ +RUN apt-get update && apt-get install -y \ texinfo \ imagemagick \ groff \ @@ -156,12 +156,9 @@ 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 +# Allow password-less 'sudo' for all users in group 'sudo' +RUN sed "s/^%sudo.*/%sudo\tALL=(ALL) NOPASSWD:ALL/g" -i /etc/sudoers && \ + chmod a+s /usr/sbin/useradd /usr/sbin/gosu /usr/sbin/usermod -#USER vyos_bld -#WORKDIR /home/vyos_bld +COPY scripts/docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] |