Last active
April 3, 2020 03:21
-
-
Save m-esm/ea24e8955583f3a23bf9339bd06c3962 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo ' | |
FROM ubuntu | |
RUN apt update | |
RUN apt install autossh -y | |
RUN ssh-agent bash | |
ENTRYPOINT ["/usr/bin/autossh", "-M", "0", "-T", "-N", "-oStrictHostKeyChecking=no", "-oServerAliveInterval=180", "-oUserKnownHostsFile=/dev/null", "-D","0.0.0.0:8888"] | |
' > Dockerfile ; \ | |
project="ssh-tunnel" ; \ | |
sudo docker rmi ${project} --force ; \ | |
sudo docker build -t ${project} . ; \ | |
sudo docker rm ${project} --force ; \ | |
sudo docker run -d --name ${project} \ | |
--restart always \ | |
-p 8888:8888 \ | |
-v ~/.ssh:/root/.ssh \ | |
${project} \ | |
root@IP_GOES_HERE ; \ | |
sleep 3 ; \ | |
sudo docker logs ${project} ; | |
echo ' | |
FROM node:alpine | |
RUN npm i http-proxy-to-socks | |
CMD ./node_modules/.bin/hpts -s ssh-tunnel:1080 -p 8080 --host 0.0.0.0 | |
' > Dockerfile ; \ | |
project="http-to-socks" ; \ | |
sudo docker rmi ${project} --force ; \ | |
sudo docker build -t ${project} . ; \ | |
sudo docker rm ${project} --force ; \ | |
sudo docker run -d --name ${project} \ | |
--restart always \ | |
--link ssh-tunnel:ssh-tunnel \ | |
-p 8080:8080 \ | |
${project} ; \ | |
sleep 3 ; \ | |
sudo docker logs ${project} ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment