1
1
2
2
# Docker SSH tunnel
3
3
4
- ![ Docker Cloud Build Status] ( https://img.shields.io/docker/cloud/build/symfonydoge/docker-ssh-tunnel )
5
- ![ Docker Pulls] ( https://img.shields.io/docker/pulls/symfonydoge/docker-ssh-tunnel )
6
- ![ Docker Stars] ( https://img.shields.io/docker/stars/symfonydoge/docker-ssh-tunnel )
4
+ [ ![ Docker Cloud Build Status] ( https://img.shields.io/docker/cloud/build/symfonydoge/docker-ssh-tunnel )] ( https://hub.docker.com/r/symfonydoge/docker-ssh-tunnel/builds )
5
+ [ ![ Docker Pulls] ( https://img.shields.io/docker/pulls/symfonydoge/docker-ssh-tunnel )] ( https://hub.docker.com/r /symfonydoge/docker-ssh-tunnel)
6
+ [ ![ Docker Stars] ( https://img.shields.io/docker/stars/symfonydoge/docker-ssh-tunnel )] ( https://hub.docker.com/r /symfonydoge/docker-ssh-tunnel)
7
7
8
8
This docker image can be used in case when you need
9
9
an access, for example, to some service on your production server,
@@ -13,8 +13,6 @@ because some of them can be busy or just reserved.
13
13
14
14
## Usage
15
15
16
- ### docker run
17
-
18
16
### docker-compose.yml
19
17
20
18
The minimal configuration will look like:
@@ -39,6 +37,25 @@ see full list of environment variables below).
39
37
Now each container in the compose project can access
40
38
tunnelled resource through ` ssh-tunnel-example:6379 ` .
41
39
40
+ ### docker run
41
+
42
+ This image mostly handy to use with compose tools like docker-compose
43
+ as an automation of port forwarding routine within docker network.
44
+ But no one can stop you (ouh) to use it directly
45
+ to make some ports of your host machine dirty,
46
+ here comes a snippet:
47
+
48
+ ```
49
+ docker run \
50
+ --name "ssh-tunnel-example" \
51
+ --rm \
52
+ -p 6379:6379 \
53
+ -v "$HOME/.ssh/id_rsa:/root/ssh-import/id_rsa:ro" \
54
+ -e "SSH_TUNNEL_HOST=corp.domain.ltd" \
55
+ -e "REMOTE_PORT=6379" \
56
+ -d symfonydoge/docker-ssh-tunnel
57
+ ```
58
+
42
59
## Environment Variables
43
60
44
61
| Name | Default value | Description |
0 commit comments