docker-ssh-forwarding/Dockerfile

23 lines
501 B
Docker

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
RUN apt-get install -y openssh-server
RUN ssh-keygen -t rsa -b 4096 -N "" -f /root/.ssh/id_rsa
CMD /bin/bash && 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