https://github.com/343max/docker-port-forwarder
https://github.com/343max/docker-port-forwarder
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/343max/docker-port-forwarder
- Owner: 343max
- Created: 2024-02-29T12:14:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-29T13:40:58.000Z (about 2 years ago)
- Last Synced: 2024-04-14T14:21:04.659Z (almost 2 years ago)
- Language: Shell
- Size: 1.95 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-port-forwarder.sh
Port forwarding via ssh to docker containers.
I have several servers with several docker containers. Sometimes I want to forward a port to localhost from this machine e.g. to use a nice GUI to connect to my database.
## Usage
```sh
docker-port-forwarder [optional: local port]
```
### Examples:
to connect to the postgres database in a client project:
```sh
docker-port-forwarder dev-server fbn-db 5432
```
to connect to the mysql database on my webserver:
```sh
docker-port-forwarder 343max.de wordpress-db 3306
```
to redirect the http port of my nginx to port 8080 on my machine:
```sh
docker-port-forwarder 343max.de nginx 80 8088
```
## Installation
you might copy `docker-port-forwarder.sh` into your path or clone this repo and add the path to your `$PATH`
## Requirements:
`jq`