Skip to content

Commit 48fc429

Browse files
docker: multiple updates
* Update Debian base image to 12 * Add --break-system-packages option to pip3 install command * Remove chmod a+s from Dockerfile (newer versions of gosu in particular don't support this) * Add sudo to relevant commands in entrypoint.sh * Add UID_MIN key to adduser command (allows the container to run on MacOS) * Formatting and spelling fixes
1 parent a2c9827 commit 48fc429

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

docker/Dockerfile

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Must be run with --privileged flag
22
# Recommended to run the container with a volume mapped
33
# in order to easy exprort images built to "external" world
4-
FROM debian:11
4+
FROM debian:12
55
LABEL authors="VyOS Maintainers <[email protected]>"
66

77
ENV DEBIAN_FRONTEND noninteractive
@@ -27,30 +27,26 @@ RUN apt-get update && apt-get install -y \
2727
curl \
2828
dos2unix
2929

30-
31-
32-
RUN pip3 install Sphinx
33-
RUN pip3 install sphinx-rtd-theme
34-
RUN pip3 install sphinx-autobuild
35-
RUN pip3 install sphinx-notfound-page
36-
RUN pip3 install lxml
37-
RUN pip3 install myst-parser
38-
RUN pip3 install sphinx_design
39-
30+
RUN pip3 install --break-system-packages \
31+
Sphinx \
32+
sphinx-rtd-theme \
33+
sphinx-autobuild \
34+
sphinx-notfound-page \
35+
lxml \
36+
myst-parser \
37+
sphinx_design
4038

4139
# Cleanup
4240
RUN rm -rf /var/lib/apt/lists/*
4341

4442
EXPOSE 8000
4543

4644
# Allow password-less 'sudo' for all users in group 'sudo'
47-
RUN sed "s/^%sudo.*/%sudo\tALL=(ALL) NOPASSWD:ALL/g" -i /etc/sudoers && \
48-
chmod a+s /usr/sbin/useradd /usr/sbin/groupadd /usr/sbin/gosu /usr/sbin/usermod
49-
45+
RUN sed "s/^%sudo.*/%sudo\tALL=(ALL) NOPASSWD:ALL/g" -i /etc/sudoers
5046

5147
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
5248

53-
# we need to convert the entrypoint with appropriate line endings, else
49+
# We need to convert the entrypoint with appropriate line endings, else
5450
# there will be an error:
5551
# standard_init_linux.go:175: exec user process caused
5652
# "no such file or directory"

docker/entrypoint.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ if ! grep -q $NEW_GID /etc/group; then
2323
groupadd --gid $NEW_GID $USER_NAME
2424
fi
2525

26-
useradd --shell /bin/bash --uid $NEW_UID --gid $NEW_GID --non-unique --create-home $USER_NAME
26+
useradd --shell /bin/bash --uid $NEW_UID --gid $NEW_GID --non-unique --create-home $USER_NAME --key UID_MIN=500
2727
usermod --append --groups sudo $USER_NAME
28-
sudo chown $NEW_UID:$NEW_GID /home/$USER_NAME
28+
chown $NEW_UID:$NEW_GID /home/$USER_NAME
2929
export HOME=/home/$USER_NAME
3030

3131
# Execute process
32-
exec /usr/sbin/gosu $USER_NAME "$@"
32+
/usr/sbin/gosu $USER_NAME "$@"

0 commit comments

Comments
 (0)