docker-ssh-forwarding/Dockerfile

23 lines
488 B
Docker
Raw Normal View History

2024-06-04 15:56:49 +08:00
FROM ubuntu
MAINTAINER ZK <zkalgclub@163.com>
WORKDIR $MYPATH
RUN apt-get update
RUN apt-get install -y vim
RUN apt-get install -y net-tools
RUN apt-get install -y iputils-ping
2024-06-04 16:21:21 +08:00
RUN apt-get install -y openssh-server
2024-06-04 15:56:49 +08:00
2024-06-04 17:38:25 +08:00
RUN ssh-keygen -t rsa -b 4096 -N "" -f /root/.ssh/id_rsa
2024-06-04 16:21:21 +08:00
CMD ssh \
2024-06-04 15:56:49 +08:00
-C \
-f \
-N \
-g \
-p $REMOTE_PORT \
-L $LOCAL_LISTEN_PORT:$LOCAL_LISTEN_HOST:$REMOTE_LISTEN_PORT $REMOTE_USER@$REMOTE_HOST \
&& while true; do sleep 10; done;
EXPOSE 1-65535