Spaces:
Build error
Build error
accplan
commited on
Commit
·
ce20592
1
Parent(s):
acdd17c
test
Browse files- Dockerfile +6 -30
- Dockerfile_old +34 -0
Dockerfile
CHANGED
@@ -1,34 +1,10 @@
|
|
|
|
1 |
FROM alpine:latest
|
2 |
-
LABEL maintainer="victorych"
|
3 |
RUN apk add --update --no-cache openssh
|
4 |
-
RUN
|
|
|
|
|
|
|
5 |
RUN echo 'Port 7860' >> /etc/ssh/sshd_config
|
6 |
-
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
|
7 |
-
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
8 |
-
RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
|
9 |
-
RUN echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config
|
10 |
-
RUN echo 'PermitTunnel yes' >> /etc/ssh/sshd_config
|
11 |
-
RUN echo 'GatewayPorts yes' >> /etc/ssh/sshd_config
|
12 |
-
RUN echo 'PidFile /home/user/ssh.pid' >> /etc/ssh/sshd_config
|
13 |
-
|
14 |
-
RUN cat /etc/ssh/sshd_config
|
15 |
-
|
16 |
-
RUN adduser -h /home/user -s /bin/sh -D user
|
17 |
-
RUN echo -n 'user:test' | chpasswd
|
18 |
-
USER user
|
19 |
-
ENV HOME=/home/user \
|
20 |
-
PATH=/home/user/.local/bin:$PATH
|
21 |
-
|
22 |
-
RUN mkdir $HOME/app
|
23 |
-
|
24 |
-
WORKDIR $HOME/app
|
25 |
-
|
26 |
EXPOSE 7860
|
27 |
-
|
28 |
-
USER root
|
29 |
-
|
30 |
-
RUN exit 1
|
31 |
-
|
32 |
-
CMD ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 && \
|
33 |
-
/usr/sbin/sshd -h $HOME/.ssh/id_ed25519 -D -e "$@"
|
34 |
-
# -D
|
|
|
1 |
+
# Instruction for Dockerfile to create a new image on top of the base image (nvidia/cuda:11.0-base)
|
2 |
FROM alpine:latest
|
|
|
3 |
RUN apk add --update --no-cache openssh
|
4 |
+
RUN mkdir /var/run/sshd
|
5 |
+
RUN echo "root:root" | chpasswd
|
6 |
+
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
7 |
+
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
8 |
RUN echo 'Port 7860' >> /etc/ssh/sshd_config
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
EXPOSE 7860
|
10 |
+
CMD ["/usr/sbin/sshd", "-D"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile_old
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM alpine:latest
|
2 |
+
LABEL maintainer="victorych"
|
3 |
+
RUN apk add --update --no-cache openssh
|
4 |
+
RUN echo 'ListenAddress 0.0.0.0' >> /etc/ssh/sshd_config
|
5 |
+
RUN echo 'Port 7860' >> /etc/ssh/sshd_config
|
6 |
+
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
|
7 |
+
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
8 |
+
RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
|
9 |
+
RUN echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config
|
10 |
+
RUN echo 'PermitTunnel yes' >> /etc/ssh/sshd_config
|
11 |
+
RUN echo 'GatewayPorts yes' >> /etc/ssh/sshd_config
|
12 |
+
RUN echo 'PidFile /home/user/ssh.pid' >> /etc/ssh/sshd_config
|
13 |
+
|
14 |
+
RUN cat /etc/ssh/sshd_config
|
15 |
+
|
16 |
+
RUN adduser -h /home/user -s /bin/sh -D user
|
17 |
+
RUN echo -n 'user:test' | chpasswd
|
18 |
+
USER user
|
19 |
+
ENV HOME=/home/user \
|
20 |
+
PATH=/home/user/.local/bin:$PATH
|
21 |
+
|
22 |
+
RUN mkdir $HOME/app
|
23 |
+
|
24 |
+
WORKDIR $HOME/app
|
25 |
+
|
26 |
+
EXPOSE 7860
|
27 |
+
|
28 |
+
USER root
|
29 |
+
|
30 |
+
RUN exit 1
|
31 |
+
|
32 |
+
CMD ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 && \
|
33 |
+
/usr/sbin/sshd -h $HOME/.ssh/id_ed25519 -D -e "$@"
|
34 |
+
# -D
|