johanhaleby / docker-machine-port-forwarder Goto Github PK
View Code? Open in Web Editor NEWSimple bash script that makes it easier to forward ports from Docker Machine
License: Apache License 2.0
Simple bash script that makes it easier to forward ports from Docker Machine
License: Apache License 2.0
When I'm running under root, I've got the error:
sudo pf 443
machine does not exist
It seems, sudo can't see the docker-machine. So, I'm usually solving the problem just connecting to docker-machine: docker-machine ssh default
in one tab. In the other tab, I'm searching for the running process: ps aux | grep ssh
. I've got something like that:
ivan 44949 0.0 0.1 4279248 5708 s003 S+ 7:06PM 0:00.04 /usr/bin/ssh -F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -o IdentitiesOnly=yes -i /Users/ivan/.docker/machine/machines/default/id_rsa -p 51651
Then I'm running the same command under root, but I'm adding -f -N -L 443:localhost:443
:
sudo /usr/bin/ssh -F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -o IdentitiesOnly=yes -i /Users/ivan/.docker/machine/machines/default/id_rsa -p 51651 -f -N -L 443:localhost:443
It would be nice if there will be the working solution in the script. Thanks ;)
Great job.But I find that it's bind to 127.0.0.1 which can't be connected outside macOS.How can I make it bind to 0.0.0.0??
Previously, Docker machine is running as VirtualBox in MacOS. Currently, nope nope.
Any alternative? Or can we make two versions of this pf
script?
pf: 89: pf: Syntax error: "(" unexpected (expecting "fi")
The README mentions that pf
is a script that exposes ports between VirtualBox and the host when it comes to docker-machine
being used on macOS. However, pf
works perfectly fine if someone uses any other hypervisor for Docker, such as xhyve, the native hypervisor for macOS - docker-machine-driver-xhyve. It should be the same case with HyperKit, another virtualization based on Hypervisor.framework introduced in macOS 10.10 - docker-machine-driver-hyperkit.
After analyzing the script it is obvious that pf
is not VirtualBox dependent (as everything is done through docker-machine
CLI), but I think it could be mentioned in the README.md
as well. What do you think @johanhaleby?
And by the way - thanks for the script! Works like a charm.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.