Support Questions
Find answers, ask questions, and share your expertise

HDP Sandbox attach docker container to local network

Highlighted

HDP Sandbox attach docker container to local network

New Contributor

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!

5 REPLIES 5
Highlighted

Re: HDP Sandbox attach docker container to local network

@n00badmin

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.

8542-screen-shot-2016-10-13-at-44124-pm.png

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.

8541-screen-shot-2016-10-13-at-43627-pm.png


screen-shot-2016-10-13-at-43731-pm.png
Highlighted

Re: HDP Sandbox attach docker container to local network

New Contributor

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....

Highlighted

Re: HDP Sandbox attach docker container to local network

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.

Highlighted

Re: HDP Sandbox attach docker container to local network

Rising Star

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.

Re: HDP Sandbox attach docker container to local network

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.

Don't have an account?