Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
FROM debian:12
|
| 2 |
|
| 3 |
RUN apt update && apt install -y wget curl openssh-server openjdk-17-jre-headless
|
|
@@ -6,15 +7,17 @@ RUN apt update && apt install -y wget curl openssh-server openjdk-17-jre-headles
|
|
| 6 |
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
| 7 |
RUN echo "root:eren" | chpasswd
|
| 8 |
|
| 9 |
-
#
|
|
|
|
|
|
|
|
|
|
| 10 |
RUN mkdir -p /app
|
| 11 |
RUN echo '#!/bin/bash' > /app/start.sh
|
| 12 |
RUN echo 'service ssh start' >> /app/start.sh
|
| 13 |
RUN echo 'echo "=============================="' >> /app/start.sh
|
| 14 |
-
RUN echo 'echo "
|
| 15 |
-
RUN echo 'echo "This will give you a public SSH address"' >> /app/start.sh
|
| 16 |
RUN echo 'echo "=============================="' >> /app/start.sh
|
| 17 |
-
RUN echo 'ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R 80:localhost:22 localhost.run' >> /app/start.sh
|
| 18 |
RUN chmod +x /app/start.sh
|
| 19 |
|
| 20 |
EXPOSE 22
|
|
|
|
| 1 |
+
|
| 2 |
FROM debian:12
|
| 3 |
|
| 4 |
RUN apt update && apt install -y wget curl openssh-server openjdk-17-jre-headless
|
|
|
|
| 7 |
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
| 8 |
RUN echo "root:eren" | chpasswd
|
| 9 |
|
| 10 |
+
# Generate SSH key for localhost.run
|
| 11 |
+
RUN ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ""
|
| 12 |
+
|
| 13 |
+
# Create start script
|
| 14 |
RUN mkdir -p /app
|
| 15 |
RUN echo '#!/bin/bash' > /app/start.sh
|
| 16 |
RUN echo 'service ssh start' >> /app/start.sh
|
| 17 |
RUN echo 'echo "=============================="' >> /app/start.sh
|
| 18 |
+
RUN echo 'echo "SSH tunnel via localhost.run"' >> /app/start.sh
|
|
|
|
| 19 |
RUN echo 'echo "=============================="' >> /app/start.sh
|
| 20 |
+
RUN echo 'ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -i /root/.ssh/id_rsa -R 80:localhost:22 localhost.run' >> /app/start.sh
|
| 21 |
RUN chmod +x /app/start.sh
|
| 22 |
|
| 23 |
EXPOSE 22
|