Created 10-13-2016 08:06 PM
Anyone able to help me get the docker container that is running in the HDP 2.5 sandbox to connect directly to my lan?
My google-fu says I either need to run the sandbox container in host network mode, or perhaps expose more ports?
My issue is that the sandbox is using a non-routable ip, thus I cannot reach it from a remote client.
Any help would be appreciated!
Created on 10-13-2016 08:22 PM - edited 08-19-2019 02:35 AM
Are you using the native Docker sandbox or the VirtualBox/VMWare sandbox? By default, the VirtualBox VM is using NAT based networking. Yes, that does mean the VM IP address is not externally accessible from a host other than the machine where the VM is running. However, the VM is using port forwarding. By default it is using the IP 127.0.0.1. If you change the host IP to your host IP address, then you should be able to access the VM from outside of your local host.
If you change the adapter to Bridged, the VM will get an IP address on the same network as your workstation and other hosts. This should make the sandbox addressable. Since the VM is mapping ports to the Docker container inside of it, you should be able to access the docker container externally by using the address the VM gets when it comes up.
Created 10-13-2016 08:50 PM
i am using the vmware install, and while some components of the docker container are indeed accessible, I need the docker container to own an IP on the lan rather than rely on forwarding. I think I will just go straight docker container rather than having it run behind the vmware host....unless there is an easy way to re-jig this....
Created 10-13-2016 09:24 PM
I personally think running the native/straight Docker container may be easier for you. I've personally started using that version of the sandbox more often.
Here is my article on installing the Docker version on a Mac: HCC Article. Here is another article on managing multiple "copies" of the sandbox: HCC Article
The short info is this: you can't change change the Docker ports after the container has been created. However, adding ports is as simple as adding another -p
switch to the docker run
command.
Created 10-14-2016 12:06 PM
Keep in mind though, you need to remove the existing container to add ports to it since it cannot be done to existing containers unfortunately.
Created 10-15-2016 11:39 AM
That is correct. You have to run
docker rm <image name>
to remove the existing container. Then you can run the docker run ...
command with the additional -p
ports added.