Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Forward2Docker Circle CI

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.


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.


Tool is available in two options:

  1. Binaries. You can download the latest binaries from here:
  2. Go distribution. Install by running 'go get'
  3. Build it yourself. See "Contributing" section


  1. Run some Docker container: $ docker run --name f2dtest -d -p 8000:80 nginx
  2. Open terminal and run forward2docker: $ forward2docker (NOTE: it runs in foreground, do not kill it, otherwise mappings will not be updated)
  3. Ensure that port is mapped to your host: $ curl http://localhost:8000
  4. Kill your container: $ docker kill f2dtest
  5. Ensure that port is unmapped (you should see 'Connection refused'): $ curl http://localhost:8000
  6. Run few more containers and verify that you can access them on localhost


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.


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


Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker or Docker Machine VM






No packages published