Merge pull request #309 from sarthurdev/current

debian: T5003: Fix docker entrypoint
This commit is contained in:
Christian Breunig 2023-02-21 15:33:02 +01:00 committed by GitHub
commit 29d3963f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -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"]

View File

@ -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 "$@"