Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Port mapping with EXPOSE docker instruction doesn't work #2970
Description of problem
Documentation say "If ports are specified via EXPOSE in your Dockerfile, we will proxy requests to the first port specified. Your application must be configured to listen on that port."
The port binding doesn't work for me even with EXPOSE instruction.
How was Dokku installed ?
Steps to Reproduce:
docker pull ghost docker tag ghost dokku/ghost dokku apps:create ghost dokku domains:add ghost ghost.mydomaine.com dokku deploy ghost
502 (Bad Gateway) with error message "We're sorry, but something went wrong."
@josegonzalez Now I have a different result with
Expected result :
Here the output of
Ah okay, so what happens here is that when you run:
That sets the default port map. We don't override that in any case, so what you're seeing is the defaults taking over. If you skip that, then we pull the exposed ports and would set the mapping like so:
When you have a domain available, you can pre-empt this by running the following command:
In cases where you don't have a domain for your application, you'll need to set the port map afterwards and run
We will never use port 80 as the host port if we detect the dockerfile/image has a specific port exposed. This was because it was confusing many of our raw dockerfile users who specified ports for a reason.
The fix here is just better documentation around port handling. I'll see if I can split out all those docs into one cohesive page.