It looks like a DNS issue.
elm binary will use the DNS nameservers from /etc/resolv.conf
to resolve domain names, and IIRC TCP queries are not supported. So maybe first check that this works fine:
You could open a shell inside your container, install dig
and test that package.elm-lang.org resolution always works correctly in UDP:
docker run -it --rm alpine:3.11.2 /bin/ash
then inside the container:
apk update
apk add bind-tools
then
# Replace 192.168.100.1 by the nameserver defined in your /etc/resolv.conf
dig @192.168.100.1 +noall +answer +notcp +retry=0 package.elm-lang.org
You should get:
package.elm-lang.org. 14116 IN A 45.55.106.189
Run it several times to check that it is reliable (maybe in a loop).
Also to be sure it’s not linked to your local DNS resolution, try to add the following command in your Dockerfile
before the elm make
one:
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf
Then try to build again.