ERR_EMPTY_RESPONSE connecting to a Docker container in Chrome

When you get this error it means you’ve exposed the right port in your Dockerfile, but you have to make sure the app within your container is binding to 0.0.0.0 instead of localhost or 127.0.0.1.

I got this error using Angular CLI’s ng serve within a container. I had to add –host=0.0.0.0 to the ENTRYPOINT arguments. If you’re using a different framework check for a similar command-line argument, configuration parameter or setting.

Leave a Reply

Your email address will not be published. Required fields are marked *