rebiuld
Browse files- Dockerfile +6 -37
- Dockerfile copy +42 -0
- Dockerfile-nginx-ssh +0 -29
- README.md +1 -1
Dockerfile
CHANGED
@@ -1,42 +1,11 @@
|
|
1 |
FROM ubuntu:20.04
|
2 |
|
3 |
-
RUN
|
4 |
-
|
5 |
-
apt update && \
|
6 |
-
apt install -y sudo && \
|
7 |
-
echo "leo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
8 |
-
# RUN echo "leo ALL=(ALL) NOPASSWD: ALL">> /etc/sudoers
|
9 |
-
USER leo
|
10 |
-
ENV HOME=/home/leo \
|
11 |
-
PATH=/home/leo/.local/bin:$PATH
|
12 |
-
WORKDIR $HOME
|
13 |
-
EXPOSE 80
|
14 |
-
# COPY start.sh /root/start.sh
|
15 |
-
# set password
|
16 |
-
# init
|
17 |
-
RUN sudo apt update && sudo apt install openssh-server nginx -y
|
18 |
-
# /etc/init.d/ssh start
|
19 |
-
# RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
|
20 |
-
# yes | unminimize && \
|
21 |
-
# apt install -y bash-completion git curl wget vim
|
22 |
|
23 |
-
|
24 |
-
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
# RUN mkdir -p /run/sshd
|
30 |
-
#ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ''
|
31 |
-
# COPY ./id_rsa* ~/.ssh/
|
32 |
-
# echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
33 |
-
ADD --chown=leo https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz ./
|
34 |
-
|
35 |
-
RUN sudo tar -zxf ngrok-v3-stable-linux-amd64.tgz && \
|
36 |
-
sudo ./ngrok config add-authtoken 2Uym7MToTptND58tapCPscX7UyC_81x66N91ecUQBPyWNqHCC
|
37 |
-
# RUN mkdir -p /run/sshd
|
38 |
-
# RUN chmod +x /root/start.sh
|
39 |
-
CMD sudo service nginx start && sudo /etc/init.d/ssh start && sudo ./ngrok tcp 22
|
40 |
-
# CMD ["/bin/sh","/root/start.sh"]
|
41 |
-
# CMD /etc/init.d/ssh start > /dev/null 2>&1 && ./ngrok tcp 22 && echo "completed"
|
42 |
-
# CMD ["/bin/bash","service ssh start && ./ngrok tcp 22"]
|
|
|
1 |
FROM ubuntu:20.04
|
2 |
|
3 |
+
# RUN echo "leo:zxcvbnm" | chpasswd
|
4 |
+
RUN apt update
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
WORKDIR /workspace
|
7 |
+
EXPOSE 8080
|
8 |
|
9 |
+
RUN curl -fsSL https://raw.githubusercontent.com/cdr/code-server/main/install.sh | sh
|
10 |
|
11 |
+
CMD ["code-server"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile copy
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:20.04
|
2 |
+
|
3 |
+
RUN useradd -m -u 1000 leo && \
|
4 |
+
echo "leo:zxcvbnm" | chpasswd && \
|
5 |
+
apt update && \
|
6 |
+
apt install -y sudo && \
|
7 |
+
echo "leo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
8 |
+
# RUN echo "leo ALL=(ALL) NOPASSWD: ALL">> /etc/sudoers
|
9 |
+
USER leo
|
10 |
+
ENV HOME=/home/leo \
|
11 |
+
PATH=/home/leo/.local/bin:$PATH
|
12 |
+
WORKDIR $HOME
|
13 |
+
EXPOSE 80
|
14 |
+
# COPY start.sh /root/start.sh
|
15 |
+
# set password
|
16 |
+
# init
|
17 |
+
RUN sudo apt update && sudo apt install openssh-server nginx -y
|
18 |
+
# /etc/init.d/ssh start
|
19 |
+
# RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
|
20 |
+
# yes | unminimize && \
|
21 |
+
# apt install -y bash-completion git curl wget vim
|
22 |
+
|
23 |
+
# SSH
|
24 |
+
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak && \
|
25 |
+
|
26 |
+
# UN curl -fsSL https://raw.githubusercontent.com/cdr/code-server/main/install.sh | sh
|
27 |
+
|
28 |
+
# RUN sudo echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
29 |
+
# RUN mkdir -p /run/sshd
|
30 |
+
#ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ''
|
31 |
+
# COPY ./id_rsa* ~/.ssh/
|
32 |
+
# echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
33 |
+
ADD --chown=leo https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz ./
|
34 |
+
|
35 |
+
RUN sudo tar -zxf ngrok-v3-stable-linux-amd64.tgz && \
|
36 |
+
sudo ./ngrok config add-authtoken 2Uym7MToTptND58tapCPscX7UyC_81x66N91ecUQBPyWNqHCC
|
37 |
+
# RUN mkdir -p /run/sshd
|
38 |
+
# RUN chmod +x /root/start.sh
|
39 |
+
CMD sudo service nginx start && sudo /etc/init.d/ssh start && sudo ./ngrok tcp 22
|
40 |
+
# CMD ["/bin/sh","/root/start.sh"]
|
41 |
+
# CMD /etc/init.d/ssh start > /dev/null 2>&1 && ./ngrok tcp 22 && echo "completed"
|
42 |
+
# CMD ["/bin/bash","service ssh start && ./ngrok tcp 22"]
|
Dockerfile-nginx-ssh
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
FROM ubuntu:20.04
|
2 |
-
USER root
|
3 |
-
EXPOSE 80 8080
|
4 |
-
# set password
|
5 |
-
RUN whoami && echo "root:zxcvbnm" | chpasswd
|
6 |
-
# init
|
7 |
-
RUN apt update
|
8 |
-
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && \
|
9 |
-
# yes | unminimize && \
|
10 |
-
apt install -y openssh-server openssh-client bash-completion git curl vim
|
11 |
-
# nginx
|
12 |
-
RUN \
|
13 |
-
apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring && \
|
14 |
-
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
|
15 |
-
| tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null && \
|
16 |
-
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
|
17 |
-
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
|
18 |
-
| tee /etc/apt/sources.list.d/nginx.list && \
|
19 |
-
apt update && apt install -y nginx
|
20 |
-
|
21 |
-
# COPY ./nginx.conf /etc/nginx/
|
22 |
-
|
23 |
-
# SSH
|
24 |
-
RUN cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak && \
|
25 |
-
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
26 |
-
# mkdir -p /run/sshd
|
27 |
-
# echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
28 |
-
|
29 |
-
CMD chown root:root / && sshd -T && service ssh start && service nginx start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
@@ -5,7 +5,7 @@ colorFrom: yellow
|
|
5 |
colorTo: red
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
-
app_port:
|
9 |
---
|
10 |
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
5 |
colorTo: red
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
+
app_port: 8080
|
9 |
---
|
10 |
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|