Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
SSH-Tunnel/client-side/docker-compose-proxy.yml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (36 sloc)
1.06 KB
This file contains 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
version: '2' | |
services: | |
# 暴露代理服务器端口( SOCKS5 协议 ) | |
ssh-to-expose-http-proxy: | |
image: jnovack/autossh | |
container_name: autossh-ssh-to-expose-http-proxy | |
environment: | |
- SSH_HOSTUSER=$SSH_HOSTUSER | |
- SSH_HOSTNAME=$SSH_HOSTNAME | |
- SSH_HOSTPORT=$SSH_HOSTPORT | |
- SSH_TUNNEL_REMOTE=$SSH_TUNNEL_REMOTE_HTTP_PROXY | |
- SSH_TUNNEL_HOST=$SSH_TUNNEL_HOST_HTTP_PROXY | |
- SSH_TUNNEL_LOCAL=$SSH_TUNNEL_LOCAL_HTTP_PROXY | |
restart: always | |
volumes: | |
- ~/.ssh/id_rsa:/id_rsa | |
# 创建本地代理( 172.17.0.1 对应宿主机的IP, 根据自己的情况替换 ) | |
ssh-to-local-proxy: | |
image: jnovack/autossh | |
container_name: autossh-ssh-to-local-proxy | |
entrypoint: | |
autossh | |
-M 0 | |
-N | |
-o ServerAliveInterval=5 | |
-o ServerAliveCountMax=1 | |
-o "ExitOnForwardFailure yes" | |
-o "StrictHostKeyChecking no" | |
-t -t | |
-i /id_rsa | |
-D 0.0.0.0:1080 | |
-p $SSH_HOSTPORT_LOCALHOST | |
$SSH_HOSTUSER_LOCALHOST@$SSH_HOSTNAME_LOCALHOST | |
restart: always | |
volumes: | |
- ~/.ssh/id_rsa:/id_rsa |