Hortonworks HDP docker how to expose ports publicly

729 Views Asked by At

First of all if I am asking a obvious question I apologize in advance.

I am trying to expose Hortonworks HDP docker (version 2.6.5) ports publicly so that the Ambari UI and all the functionality packaged is accessible over the network. I followed the official documentation everything is installed locally and running, but I cannot access the UI via the browser using the set ports.

Is there away I can make the docker ports public so it is accessible via the local network?

I am running the docker image on a Ubuntu 18 machine.

[Update]

CONTAINER ID        IMAGE                           COMMAND             CREATED             STATUS              PORTS                        NAMES
11b583b0deb5        hortonworks/sandbox-hdp:2.6.5   "/usr/sbin/init"    23 seconds ago      Up 22 seconds       22/tcp, 4200/tcp, 8080/tcp   sandbox-hdp
2

There are 2 best solutions below

0
On

By default, the Docker containers are not exposed outside the docker host. In order do expose port X on the host machine and forward traffic to port Y inside the container, use the -p/--publish option when the container is launched.

I haven't downloaded the sources, but I am more than sure that in the docker-deploy-{HDPversion}.sh script, you must find a docker run ... command, which is launching the sandbox-hdp container. Find and add to that line the publish command.

-p 9876:8080

You should then be able to access your container at localhost:9876. You may chose any port you want, that is not in use on the host machine.

0
On

You can also use the docker option:
--publish-all Publish all exposed ports to random ports