{"id":16877682,"url":"https://github.com/johanhaleby/docker-machine-port-forwarder","last_synced_at":"2025-09-07T15:43:23.686Z","repository":{"id":137467002,"uuid":"55754949","full_name":"johanhaleby/docker-machine-port-forwarder","owner":"johanhaleby","description":"Simple bash script that makes it easier to forward ports from Docker Machine","archived":false,"fork":false,"pushed_at":"2019-05-20T06:25:59.000Z","size":8,"stargazers_count":109,"open_issues_count":4,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T04:11:28.271Z","etag":null,"topics":["docker","docker-machine"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johanhaleby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-08T06:13:47.000Z","updated_at":"2023-06-15T18:42:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"08a87283-8f64-4e5a-8281-5465cb3b098f","html_url":"https://github.com/johanhaleby/docker-machine-port-forwarder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johanhaleby/docker-machine-port-forwarder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanhaleby%2Fdocker-machine-port-forwarder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanhaleby%2Fdocker-machine-port-forwarder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanhaleby%2Fdocker-machine-port-forwarder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanhaleby%2Fdocker-machine-port-forwarder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johanhaleby","download_url":"https://codeload.github.com/johanhaleby/docker-machine-port-forwarder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanhaleby%2Fdocker-machine-port-forwarder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274058943,"owners_count":25215200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-machine"],"created_at":"2024-10-13T15:44:50.540Z","updated_at":"2025-09-07T15:43:23.651Z","avatar_url":"https://github.com/johanhaleby.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Machine Port Forwarding\n\nA small bash script that makes it easier to expose ports between [docker-machine](https://docs.docker.com/machine/) (VirtualBox or macOS hypervisor like [xhyve](https://github.com/machine-drivers/docker-machine-driver-xhyve), [HyperKit](https://github.com/machine-drivers/docker-machine-driver-hyperkit) etc.) and the host when using Docker Machine on macOS. The script is called `pf` which stands for \"port forward\". You can also read more on this [blog](http://code.haleby.se/2016/04/08/docker-machine-port-forwarding/).\n\n## Usage\n\n\t$ pf 8080\n\nForwards port 8080 in the container to port 8080 on the host in docker-machine environment `default` by opening an SSH connection to VirtualBox in the background.\n\nIf you run into this error:\n\n```bash\nHost does not exist: \"default\"\n```\n\nyou'll need to specify the name of your docker-machine environment. For example:\n\n\t$ pf 8080 -e dev\n\nThis will use the `dev` docker-machine environment.\n\n### Stopping the port forwarding\n\nIf you've started port forwarding in the background (default) you can easily stop it using:\n\n\t$ pf 8080 -s\n\nNote that you don't need to specify an environment (`-e`) for this to work.\n\n### Port Mapping\n\nYou can map the docker port to another port on the host like this:\n\n\t$ pf 8090:8080\n\nThis will map port 8090 on the host to port 8080 running in the container.\n\n### Foreground\n\nYou can also start the port forwarding process in the foreground:\n\n\t$ pf 8080 -f\n\nIf you do this you'll see the docker-machine and once it's shutdown the port forwarding is also stopped automatically (i.e. no need to run `pf 8080 -s`).\n\n### Help\n\nRun `pf -h` to for more options\n\n### Advanced\n\nIf you need more advanced options just use the vanilla `docker-machine` command. The purpose of `pf` is to make it really easy to do the most basic things.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanhaleby%2Fdocker-machine-port-forwarder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohanhaleby%2Fdocker-machine-port-forwarder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanhaleby%2Fdocker-machine-port-forwarder/lists"}