Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit 2670ff3

Browse files
StevenBOULLEdiemol
andauthored
Update Dockerfile (SeleniumHQ#1773)
* Tuning chmod permissions * Kick CI * More tuning * Tuning a bit more * Update Dockerfile Change rights to 775 * Update Dockerfile Change rights * Tuning chmod permissions * More tuning * Tuning a bit more * Change group for some directories Change group of directories "/opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor" to group seluser * Usage of ACL Usage of ACL to stay with root's rights for user and group but add some rights to user seluser with ACL * Install ACL package * typo in command setfacl * change stefacl location on script * Change setfacl location once again * add acl to /opt * Update Dockerfile Adding sudo to avoid "permission denied" messages --------- Co-authored-by: Diego Molina <[email protected]> Co-authored-by: Diego Molina <[email protected]>
1 parent 3ecb348 commit 2670ff3

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Base/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
1818
#========================
1919
RUN apt-get -qqy update \
2020
&& apt-get -qqy --no-install-recommends install \
21+
acl \
2122
bzip2 \
2223
ca-certificates \
2324
openjdk-11-jre-headless \
@@ -76,7 +77,8 @@ RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/su
7677
&& wget --no-verbose https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/4.8.1/selenium-http-jdk-client-4.8.1.jar \
7778
-O /opt/selenium/selenium-http-jdk-client.jar \
7879
&& chgrp -R 0 /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
79-
&& chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor
80+
&& chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
81+
&& setfacl -Rm u:seluser:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor
8082

8183
#=====
8284
# Download observability related jaegar jars and make them available in a separate directory
@@ -85,11 +87,11 @@ RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/su
8587
RUN curl -fLo /tmp/cs https://github.com/coursier/launchers/raw/master/coursier \
8688
&& chmod +x /tmp/cs \
8789
&& mkdir -p /external_jars \
88-
&& chmod -R 777 /external_jars
90+
&& chmod -R 775 /external_jars
8991

9092
RUN /tmp/cs fetch --classpath --cache /external_jars io.opentelemetry:opentelemetry-exporter-jaeger:1.22.0 io.grpc:grpc-netty:1.52.1 > /external_jars/.classpath.txt
9193

92-
RUN chmod 777 /external_jars/.classpath.txt
94+
RUN chmod 664 /external_jars/.classpath.txt
9395

9496
#===================================================
9597
# Run the following commands as non-privileged user

NodeBase/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ RUN mkdir -p ${HOME}/.vnc \
141141
#==========
142142
# Relaxing permissions for OpenShift and other non-sudo environments
143143
#==========
144-
RUN sudo chmod -R 777 ${HOME} \
144+
RUN sudo chmod -R 775 ${HOME} \
145145
&& sudo chgrp -R 0 ${HOME} \
146146
&& sudo chmod -R g=u ${HOME}
147147

NodeChrome/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ RUN if [ -z "$CHROME_DRIVER_VERSION" ]; \
5252
&& echo "Using chromedriver version: "$CHROME_DRIVER_VERSION \
5353
&& wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
5454
&& rm -rf /opt/selenium/chromedriver \
55-
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
55+
&& sudo unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
5656
&& rm /tmp/chromedriver_linux64.zip \
57-
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
58-
&& chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
57+
&& sudo mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
58+
&& sudo chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
5959
&& sudo ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
6060

6161

6262
#============================================
6363
# Dumping Browser name and version for config
6464
#============================================
65-
RUN echo "chrome" > /opt/selenium/browser_name
65+
RUN echo "chrome" > /opt/selenium/browser_name

0 commit comments

Comments
 (0)