-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 #1073
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR @srguglielmo!
I added a comment several times.
Could you please send this PR to the https://github.com/SeleniumHQ/docker-selenium/tree/selenium-4-alpha branch too?
@@ -5,7 +5,7 @@ | |||
FROM selenium/base:3.141.59-20200525 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -75,7 +75,7 @@ RUN apt-get -qqy update \ | |||
# Run the following commands as non-privileged user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -32,7 +32,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -24,7 +24,7 @@ RUN apt-get update -qqy \ | |||
fluxbox \ | |||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* | |||
|
|||
USER seluser | |||
USER 1200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -37,7 +37,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 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -5,7 +5,7 @@ | |||
FROM selenium/node-chrome-debug:3.141.59-20200525 | |||
LABEL authors=SeleniumHQ | |||
|
|||
USER seluser | |||
USER 1200 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -5,7 +5,7 @@ | |||
FROM selenium/node-firefox:3.141.59-20200525 | |||
LABEL authors=SeleniumHQ | |||
|
|||
USER seluser | |||
USER 1200 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -5,7 +5,7 @@ | |||
FROM selenium/node-firefox-debug:3.141.59-20200525 | |||
LABEL authors=SeleniumHQ | |||
|
|||
USER seluser | |||
USER 1200 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -5,7 +5,7 @@ | |||
FROM selenium/node-opera:3.141.59-20200525 | |||
LABEL authors=SeleniumHQ | |||
|
|||
USER seluser | |||
USER 1200 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
@@ -5,7 +5,7 @@ | |||
FROM selenium/node-opera-debug:3.141.59-20200525 | |||
LABEL authors=SeleniumHQ | |||
|
|||
USER seluser | |||
USER 1200 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please only change the Dockerfile.txt
files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to request changes not approve.
Description
By using a numeric
USER
instruction in Dockerfiles, the images are now able to pass a strict KubernetessecurityContext
configuration. Specifically,runAsNonRoot
, which requires a numeric user/group ID. It is also a Docker best practice. The values of 1200 and 1201 are arbitrary.Motivation and Context
While running a Selenium grid cluster in Kubernetes, I noticed I was unable to run the images with
runAsNonRoot: true
due to the following error:Types of changes
Checklist
Here's an example of the k8s config that runs successfully after this patch:
I can run
VERSION=local make build
locally successfully. Let me know if there's anything I can change or if this can be tested somehow.Thanks,
Steve