Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a numeric USER instruction in Dockerfiles #1082

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ RUN echo "${TZ}" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata

#========================================
# Add normal user with passwordless sudo
# Add normal user and group with passwordless sudo
#========================================
RUN useradd seluser \
--shell /bin/bash \
RUN groupadd seluser \
--gid 1201 \
&& useradd seluser \
--create-home \
--gid 1201 \
--shell /bin/bash \
--uid 1200 \
&& usermod -a -G sudo seluser \
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& echo 'seluser:secret' | chpasswd
Expand Down Expand Up @@ -75,7 +79,7 @@ RUN mkdir -p /opt/selenium /var/run/supervisor /var/log/supervisor \
#===================================================
# Run the following commands as non-privileged user
#===================================================
USER seluser
USER 1200:1201


CMD ["/opt/bin/entry_point.sh"]
2 changes: 1 addition & 1 deletion Hub/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
USER seluser
USER 1200

#========================
# Selenium Configuration
Expand Down
2 changes: 1 addition & 1 deletion NodeBase/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ RUN apt-get -qqy update \
# Run the following commands as non-privileged user
#===================================================

USER seluser
USER 1200

#==============================
# Scripts to run Selenium Node and XVFB
Expand Down
2 changes: 1 addition & 1 deletion NodeChrome/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary
RUN /opt/bin/wrap_chrome_binary

USER seluser
USER 1200

#============================================
# Chrome webdriver
Expand Down
2 changes: 1 addition & 1 deletion NodeDebug/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update -qqy \
fluxbox \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

USER seluser
USER 1200

#==============================
# Generating the VNC password as seluser
Expand Down
2 changes: 1 addition & 1 deletion NodeFirefox/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.
&& chmod 755 /opt/geckodriver-$GK_VERSION \
&& ln -fs /opt/geckodriver-$GK_VERSION /usr/bin/geckodriver

USER seluser
USER 1200

COPY generate_config /opt/bin/generate_config

Expand Down
2 changes: 1 addition & 1 deletion NodeOpera/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN wget -q -O - https://deb.opera.com/archive.key | apt-key add - \
COPY wrap_opera_binary /opt/bin/wrap_opera_binary
RUN /opt/bin/wrap_opera_binary

USER seluser
USER 1200

#=====================
# Opera webdriver
Expand Down
2 changes: 1 addition & 1 deletion Standalone/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
USER seluser
USER 1200

#====================================
# Scripts to run Selenium Standalone
Expand Down