https://github.com/fuco1/docker-tunnel
Passwordless-root-login box running sshd - ideal for bridging connections into docker networks.
https://github.com/fuco1/docker-tunnel
Last synced: about 1 month ago
JSON representation
Passwordless-root-login box running sshd - ideal for bridging connections into docker networks.
- Host: GitHub
- URL: https://github.com/fuco1/docker-tunnel
- Owner: Fuco1
- Created: 2017-05-10T12:31:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-10T16:44:36.000Z (almost 9 years ago)
- Last Synced: 2025-06-24T06:43:08.240Z (9 months ago)
- Size: 1000 Bytes
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-tunnel
For when you want to "wrap" a service running on different docker network for local access. This is useful for example when you don't want to expose ports in the original service (because you might for instance not know what ports will be free or where the stack will run etc.).
# usage
With `docker-compose` you can create a tunnel sending all the local trafic to some service in a specified docker network
``` yaml
version: '2'
services:
tunnel:
image: fuco1/docker-tunnel
ports:
# enable ssh tunelling from localhost only
- "127.0.0.1:2222:22"
networks:
- app-backend-network
networks:
app-backend-network:
external:
name: app_backend-network
```
Then start it up with
docker-compose up -d
and set up a tunnel with ssh
# suppose there is a service `mysql` in `backend-network` for docker-compose stack `app`
ssh -T root@127.0.0.1 -p 2222 -L 127.0.0.1:33306:mysql:3306