-
Notifications
You must be signed in to change notification settings - Fork 0
Expose Kitura's Port in Docker Container to Host Machine
These are the steps to expose Kitura's port in a Docker container to the host (e.g. an OS X laptop):
-
Execute
docker run -d -P ibmcom/kitura-ubuntu:latest
. -
Execute
docker ps
. -
Inspect the values under the PORTS column for the container you just started. You should see something like the following:
0.0.0.0:32768->8090/tcp
. This means that Kitura’s port8090
in the Docker container is mapped to port32768
on the host. Now, the host in this case is not the OS X laptop. Instead, it is the Virtual Box machine that Docker uses. -
Go to Virtual Box, and open the settings for the virtual machine that is running Docker (i.e. right click on the virtual machine and select
Settings
). -
Go to the Network tab and click on
Port Forwarding
. -
Add a new row with the following values:
- name: kitura
- protocol: tcp
- host ip: 127.0.0.1
- host port: 8090
- guest port: <the host port reported under the PORTS column (e.g. 32768)>
-
Click OK and OK again to save the settings for the virtual machine.
-
Open your browser and go to: http://localhost:8090 and you should see the Kitura welcome page.