Help us shape the future of Go! Take the 2026 Go Developer Survey

docker-port-forward

command module
v0.0.0-...-6e95413 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 6 Imported by: 0

README

docker-port-forward

A Docker CLI plugin that mirrors the kubectl port-forward interface. Forward one or more local ports to a running container or a Docker Compose service, without publishing ports or modifying the container.

Installation

Install as a Docker CLI plugin with a single command:

curl -fsSL https://raw.githubusercontent.com/dokku/docker-port-forward/main/install.sh | sh

Or build from source:

make install

Or download a pre-built binary from GitHub Releases and place it in ~/.docker/cli-plugins/ as docker-pf. See the Getting Started guide for details.

Once installed, the plugin is available via docker pf.

Usage

Forward localhost:8080 to port 80 on a running container:

docker pf my-container 8080:80

Auto-allocate a local port:

docker pf my-container :5000

Forward to a Compose service by name (with an auto-detected compose file):

docker pf service/web 8080:80

Forward multiple ports at once:

docker pf my-container 8080:80 5432:5432

Auto-detect all non-loopback TCP and UDP listeners in a container and forward each on its own port:

docker pf my-container

Forward UDP (DNS-style):

docker pf my-dns 5353:53/udp

Mix TCP and UDP in one invocation:

docker pf my-app 8080:80 53:53/udp

Run in the background and give the helper an explicit name:

docker pf --detach --name mydb my-db 5432:5432

Remove any leftover helper containers from crashed or detached sessions:

docker pf cleanup
docker pf cleanup --name mydb

See the command reference for all flags and options.

Documentation

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package portforward forwards local ports to running Docker containers or Compose services.
Package portforward forwards local ports to running Docker containers or Compose services.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL