-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (64 loc) · 2.25 KB
/
Dockerfile
File metadata and controls
76 lines (64 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM selenium/standalone-chrome:latest
# Variables
ENV MAVEN_VERSION=3.6.0 \
MAVEN_HOME=/usr/lib/mvn \
NODE_VERSION=10.14.2 \
SHELL=/bin/bash \
LANG=en_US.UTF-8 \
CSVER=3.2.0 \
GAUGE_VER=1.0.8 \
VAULT_VER=1.3.4 \
PATH=$MAVEN_HOME/bin:/usr/local/bin:$PATH
COPY docker-entrypoint.sh /usr/local/bin/
# Packages
USER root
RUN apt-get update \
&& apt-get install -y openjdk-11-jdk \
curl \
dumb-init \
&& curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - \
&& apt-get install -y \
nodejs \
maven \
net-tools \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/oracle-jdk11-installer \
&& npm install -g npmlog
# https://wiki.debian.org/Locale#Manually
RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \
&& locale-gen \
&& chsh -s /bin/bash \
&& echo "seluser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
# Install Vault
RUN curl -SsL -o vault.zip https://releases.hashicorp.com/vault/${VAULT_VER}/vault_${VAULT_VER}_linux_amd64.zip \
&& unzip -q vault.zip \
&& cp ./vault /usr/local/bin/
# Install Gauge
RUN curl -SsL -o gauge.zip https://github.com/getgauge/gauge/releases/download/v${GAUGE_VER}/gauge-${GAUGE_VER}-linux.x86_64.zip \
&& unzip -q gauge.zip \
&& cp ./gauge /usr/local/bin/ \
&& cd ../tmp \
&& rm -rf tmp \
&& gauge install java \
&& gauge install js \
&& gauge install screenshot \
&& gauge install html-report \
&& gauge install xml-report
# Install fixuid
RUN curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.4/fixuid-0.4-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - \
&& chown root:root /usr/local/bin/fixuid \
&& chmod 4755 /usr/local/bin/fixuid \
&& mkdir -p /etc/fixuid \
&& printf "user: seluser\ngroup: seluser\n" > /etc/fixuid/config.yml
# Install Code-Server
RUN cd /tmp && \
curl -SsL https://github.com/cdr/code-server/releases/download/${CSVER}/code-server-${CSVER}-linux-x86_64.tar.gz | tar -xzf - \
&& mv code-server* /usr/local/lib/code-server \
&& ln -s /usr/local/lib/code-server/code-server /usr/local/bin/code-server
USER seluser
EXPOSE 8080
WORKDIR /home/seluser
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["dumb-init", "fixuid", "-q", "/usr/local/bin/code-server", "--host", "0.0.0.0", "/home/seluser"]