diff options
author | Christian Breunig <christian@breunig.cc> | 2023-02-21 15:33:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 15:33:02 +0100 |
commit | 29d3963f6033b258ad433aeacac1b62cf9ebbfaf (patch) | |
tree | 9ec30f4ef8cf5a052172f62674996f6ef6b00318 | |
parent | df13175a2e37d12fad7ed8a60d92faac1428ddf2 (diff) | |
parent | 213418f181aba3866249d853c381696ea960b157 (diff) | |
download | vyos-build-29d3963f6033b258ad433aeacac1b62cf9ebbfaf.tar.gz vyos-build-29d3963f6033b258ad433aeacac1b62cf9ebbfaf.zip |
Merge pull request #309 from sarthurdev/current
debian: T5003: Fix docker entrypoint
-rw-r--r-- | docker/Dockerfile | 8 | ||||
-rwxr-xr-x | docker/entrypoint.sh | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index d13ac7cc..2ba2125f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -257,9 +257,6 @@ RUN export LIBYANG_COMMIT="v2.0.164" && \ cd libyang && git checkout $LIBYANG_COMMIT && apkg build -i && \ cd pkg/pkgs/debian-*/libyang2_* && dpkg -i *.deb -# FRR documentation also has a dependency on an up to date spinx version -RUN pip install sphinx==4.0.2 - # Packages needed to build FRR itself # https://github.com/FRRouting/frr/blob/master/doc/developer/building-libyang.rst # for more info @@ -286,6 +283,7 @@ RUN apt-get update && apt-get install -y \ python3 \ python3-dev \ python3-pytest \ + python3-sphinx \ texinfo # Packages needed for hvinfo @@ -574,7 +572,8 @@ RUN gem install --no-document fpm # 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/groupadd /usr/sbin/usermod + echo "vyos_bld\tALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ + chmod a+s /usr/sbin/useradd /usr/sbin/groupadd # Ensure sure all users have access to our OCAM and Go installation RUN echo "$(opam env --root=/opt/opam --set-root)" >> /etc/skel/.bashrc && \ @@ -587,4 +586,5 @@ RUN rm -rf /tmp/* RUN echo -e "set mouse=\nset ttymouse=" > /etc/vim/vimrc.local COPY entrypoint.sh /usr/local/bin/entrypoint.sh + ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 8db41103..adc7264c 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -24,9 +24,11 @@ if ! grep -q $NEW_GID /etc/group; then fi useradd --shell /bin/bash --uid $NEW_UID --gid $NEW_GID --non-unique --create-home $USER_NAME -usermod --append --groups sudo $USER_NAME -sudo chown $NEW_UID:$NEW_GID /home/$USER_NAME export HOME=/home/$USER_NAME +if [ "$(id -u)" == "0" ]; then + exec gosu $USER_NAME "$@" +fi + # Execute process -exec /usr/sbin/gosu $USER_NAME "$@" +exec "$@" |