File size: 1,237 Bytes
184ce30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM ubuntu:latest

RUN apt-get update && apt-get install -y \
    bash \
    wget \
    curl \
    ca-certificates \
    sudo

RUN wget  -O /usr/bin/ && tar -xzf /usr/bin/zrok_0.4.23_linux_amd64.tar.gz -C /usr/bin &&

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# RUN echo 'Defaults !sysctl,!snap' > /etc/sudoers.d/no-new-privileges

RUN mkdir -p /data && chown -R 1001:1001 /data

RUN wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz \
 && tar -xzvf gotty.tar.gz -C /usr/local/bin/ \
 && chmod +x /usr/local/bin/gotty \
 && rm gotty.tar.gz

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 \
 && tar -xzvf zrok_0.4.23_linux_amd64.tar.gz -C /usr/local/bin/ \
 && chmod +x /usr/local/bin/zrok \
 && rm zrok_0.4.23_linux_amd64.tar.gz

RUN useradd -u 1001 -d /data user1001 \
 && echo 'user1001 ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/user1001 \
 && chmod 0440 /etc/sudoers.d/user1001

USER 1001
WORKDIR /data

RUN echo 'PS1="online-terminal:\\w\\$ "' > /data/.bashrc

EXPOSE 8080

CMD ["gotty", "--permit-write", "--port", "7860", "--permit-arguments", "/bin/bash", "--rcfile", "/data/.bashrc"]