Create Dockerfile
Browse files- Dockerfile +39 -0
Dockerfile
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:latest
|
2 |
+
|
3 |
+
RUN apt-get update && apt-get install -y \
|
4 |
+
bash \
|
5 |
+
wget \
|
6 |
+
curl \
|
7 |
+
ca-certificates \
|
8 |
+
sudo
|
9 |
+
|
10 |
+
RUN wget -O /usr/bin/ && tar -xzf /usr/bin/zrok_0.4.23_linux_amd64.tar.gz -C /usr/bin &&
|
11 |
+
|
12 |
+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
13 |
+
|
14 |
+
# RUN echo 'Defaults !sysctl,!snap' > /etc/sudoers.d/no-new-privileges
|
15 |
+
|
16 |
+
RUN mkdir -p /data && chown -R 1001:1001 /data
|
17 |
+
|
18 |
+
RUN wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz \
|
19 |
+
&& tar -xzvf gotty.tar.gz -C /usr/local/bin/ \
|
20 |
+
&& chmod +x /usr/local/bin/gotty \
|
21 |
+
&& rm gotty.tar.gz
|
22 |
+
|
23 |
+
RUN wget -O zrok_0.4.23_linux_amd64.tar.gz https://github.com/openziti/zrok/releases/download/v0.4.23/zrok_0.4.23_linux_amd64.tar.gz \
|
24 |
+
&& tar -xzvf zrok_0.4.23_linux_amd64.tar.gz -C /usr/local/bin/ \
|
25 |
+
&& chmod +x /usr/local/bin/zrok \
|
26 |
+
&& rm zrok_0.4.23_linux_amd64.tar.gz
|
27 |
+
|
28 |
+
RUN useradd -u 1001 -d /data user1001 \
|
29 |
+
&& echo 'user1001 ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/user1001 \
|
30 |
+
&& chmod 0440 /etc/sudoers.d/user1001
|
31 |
+
|
32 |
+
USER 1001
|
33 |
+
WORKDIR /data
|
34 |
+
|
35 |
+
RUN echo 'PS1="online-terminal:\\w\\$ "' > /data/.bashrc
|
36 |
+
|
37 |
+
EXPOSE 8080
|
38 |
+
|
39 |
+
CMD ["gotty", "--permit-write", "--port", "7860", "--permit-arguments", "/bin/bash", "--rcfile", "/data/.bashrc"]
|