Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kingsquare/docker-tunnel
a (simple) dockerized ssh tunnel
https://github.com/kingsquare/docker-tunnel
docker-tunnel ssh tunnel tunnel-container
Last synced: 2 months ago
JSON representation
a (simple) dockerized ssh tunnel
- Host: GitHub
- URL: https://github.com/kingsquare/docker-tunnel
- Owner: kingsquare
- License: isc
- Created: 2014-10-31T07:45:59.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-30T07:46:53.000Z (about 4 years ago)
- Last Synced: 2024-08-05T09:14:42.741Z (6 months ago)
- Topics: docker-tunnel, ssh, tunnel, tunnel-container
- Language: Makefile
- Homepage:
- Size: 20.5 KB
- Stars: 110
- Watchers: 12
- Forks: 29
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-network-stuff - **83**星
README
[![](https://images.microbadger.com/badges/image/kingsquare/tunnel.svg)](https://microbadger.com/images/kingsquare/tunnel "Get your own image badge on microbadger.com")
# TunnelThis is a `simple` ssh-tunnel container for easily connecting to other containers / servers elsewhere via a ```--link```-ed
tunnel container. This tunnel will use your local SSH-agent to connect to the endpoint thus no need to push your ~/.ssh/ files into
the image.# Usage
The full syntax for starting an image from this container:
docker run -d --name [$your_tunnel_name] -v $SSH_AUTH_SOCK:/ssh-agent kingsquare/tunnel *:[$exposed_port]:[$destination]:[$destination_port] [$user@][$server]
> You can append any ssh parameters
**Mac support:** ~~Please be aware that with the launch of the [Docker for Mac Beta](https://blog.docker.com/2016/03/docker-for-mac-windows-beta/) this currently doesnt work on Mac.~~ Please see this [note](https://github.com/kingsquare/docker-tunnel/issues/2#issuecomment-220782052)
# Examples
* you would like to have a tunnel port 3306 on server example.com locally exposed as 3306
```docker run -d --name tunnel_mysql -v $SSH_AUTH_SOCK:/ssh-agent kingsquare/tunnel *:3306:localhost:3306 [email protected]```
* you would like to have a tunnel port 3306 on server example.com locally exposed on the host as 3308
```docker run -d -p 3308:3306 --name tunnel_mysql -v $SSH_AUTH_SOCK:/ssh-agent kingsquare/tunnel *:3306:localhost:3306 [email protected]```
# Using as an Ambassador
This method allows for using this image as an ambassador to other (secure) servers:
docker stop staging-mongo;
docker rm staging-mongo;
docker run -d --name staging-mongo -v $SSH_AUTH_SOCK:/ssh-agent kingsquare/tunnel *:2222:127.0.0.1:27017 [email protected]docker stop production-mongo;
docker rm production-mongo;
docker run -d --name production-mongo -v $SSH_AUTH_SOCK:/ssh-agent kingsquare/tunnel *:2222:127.0.0.1:27017 [email protected]use the links in another container via exposed port 2222:
docker run --link staging-mongo:db.staging \
--link production-mongo:db.production \
my_app start