docker-ssh-forwarding/Dockerfile

21 lines
495 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
CMD rm -rf /root/.ssh && mkdir /root/.ssh && cp -R /root/ssh/* /root/.ssh/ && chmod -R 600 /root/.ssh/* && \
ssh \
-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