Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bsideup/forward2docker
Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker or Docker Machine VM
https://github.com/bsideup/forward2docker
Last synced: about 2 months ago
JSON representation
Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker or Docker Machine VM
- Host: GitHub
- URL: https://github.com/bsideup/forward2docker
- Owner: bsideup
- Created: 2015-08-01T18:25:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-06T11:05:32.000Z (over 8 years ago)
- Last Synced: 2024-10-14T09:31:25.764Z (2 months ago)
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 77
- Watchers: 11
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-docker - forward2docker - Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker VM by [@bsideup](https://github.com/bsideup) (Development with Docker / Development Environment)
- awesome-docker - forward2docker - Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker VM by [@bsideup](https://github.com/bsideup) (Development with Docker / Development Environment)
README
Forward2Docker [![Circle CI](https://circleci.com/gh/bsideup/forward2docker/tree/master.svg?style=svg)](https://circleci.com/gh/bsideup/forward2docker/tree/master)
===
Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker or Docker Machine VM.How it works?
---------
When it started it will listen for Docker events (start and die) and reconfigure port forwarding rules for your VirtualBox VM with Docker.Why?
---------
Currently even with Boot2Docker you wouldn't get all Docker experience on your OS X host because
your Docker daemon will run in VM, not on localhost, which means that you will have to use
Docker VM's IP address instead of "localhost". It causes some fragmentation between native
and non-native Docker users. But we can solve it with "Port forwarding" feature in VirtualBox.Install
---------
Tool is available in two options:1. Binaries. You can download the latest binaries from here: https://github.com/bsideup/forward2docker/releases/
1. Go distribution. Install by running 'go get github.com/bsideup/forward2docker'
1. Build it yourself. See "Contributing" sectionUsage
---------1. Run some Docker container: `$ docker run --name f2dtest -d -p 8000:80 nginx`
1. Open terminal and run forward2docker: `$ forward2docker` (NOTE: it runs in foreground, do not kill it, otherwise mappings will not be updated)
1. Ensure that port is mapped to your host: `$ curl http://localhost:8000`
1. Kill your container: `$ docker kill f2dtest`
1. Ensure that port is unmapped (you should see 'Connection refused'): `$ curl http://localhost:8000`
1. Run few more containers and verify that you can access them on localhostConfiguration
---------
no configuration required, but you can pass `--run-once` flag to prevent forward2docker to listen for events and quit right after the first port assignment.Contributing
---------
GNU Make is used as a build tool. Following commands are available:
- `make bootstrap` - you should call it (once) before you start. Will download all dependencies
- `make build` - will run `go vet`, `go fmt` and compile binary for current platform
- `make build_all` - will compile binaries for every supported platform. All binaries will be saved to `./bin/` folder