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.

Dotnet Core Build Error in Docker: Resource file “**/*.resx” cannot be found

While building my new .NET Core project using Docker I ran into an error with the two stage build:

/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(2924,5): error MSB3552: Resource file “**/*.resx” cannot be found. [/Hapthorn.csproj]
The command ‘/bin/sh -c dotnet publish -c Release -o out’ returned a non-zero code: 1

The problem it turned out was that while trying to tune my Dockerfile I’d accidentally removed the WORKDIR directive. As a result MSBuild was interpreting the *.resx as an absolute path instead of a grouping/collection directive.

To fix it I put back in a WORKDIR /src directive in my Dockerfile.

Quick and easy!