@@ -8,11 +8,15 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu xenial main universe\n" > /etc/a
8
8
&& echo "deb http://archive.ubuntu.com/ubuntu xenial-updates main universe\n " >> /etc/apt/sources.list \
9
9
&& echo "deb http://security.ubuntu.com/ubuntu xenial-security main universe\n " >> /etc/apt/sources.list
10
10
11
+ # No interactive frontend during docker build
12
+ ENV DEBIAN_FRONTEND=noninteractive \
13
+ DEBCONF_NONINTERACTIVE_SEEN=true
14
+
11
15
# ========================
12
16
# Miscellaneous packages
13
17
# Includes minimal runtime used for executing non GUI Java programs
14
18
# ========================
15
- RUN apt-get update -qqy \
19
+ RUN apt-get -qqy update \
16
20
&& apt-get -qqy --no-install-recommends install \
17
21
bzip2 \
18
22
ca-certificates \
@@ -32,16 +36,26 @@ ENV TZ "UTC"
32
36
RUN echo "${TZ}" > /etc/timezone \
33
37
&& dpkg-reconfigure --frontend noninteractive tzdata
34
38
35
- # ==========
36
- # Selenium
37
- # ==========
38
- RUN mkdir -p /opt/selenium \
39
- && wget --no-verbose https://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar -O /opt/selenium/selenium-server-standalone.jar
40
-
41
39
# ========================================
42
40
# Add normal user with passwordless sudo
43
41
# ========================================
44
- RUN sudo useradd seluser --shell /bin/bash --create-home \
45
- && sudo usermod -a -G sudo seluser \
42
+ RUN useradd seluser \
43
+ --shell /bin/bash \
44
+ --create-home \
45
+ && usermod -a -G sudo seluser \
46
46
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
47
47
&& echo 'seluser:secret' | chpasswd
48
+
49
+ # ===================================================
50
+ # Run the following commands as non-privileged user
51
+ # ===================================================
52
+ USER seluser
53
+ WORKDIR /home/seluser
54
+
55
+ # ==========
56
+ # Selenium
57
+ # ==========
58
+ RUN mkdir -p /home/seluser/selenium \
59
+ && wget --no-verbose https://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar \
60
+ -O /home/seluser/selenium/selenium-server-standalone.jar
61
+
0 commit comments