When I do following command using docker run the file downloads fine:
$ docker run mcr.microsoft.com/dotnet/aspnet:5.0-alpine3.13 apk add curl \
&& echo "start" \
&& curl -L --output file-example_PDF_1MB.pdf https://file-examples-com.github.io/uploads/2017/10/file-example_PDF_1MB.pdf && echo "done"
The file downloads fine, however when I try to download it in the container by the following Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine3.13 AS runtime
RUN apk add curl \
&& curl -L --output file-example_PDF_1MB.pdf https://file-examples-com.github.io/uploads/2017/10/file-example_PDF_1MB.pdf
The curl command fails with the following error message:
docker build -t testsem .
curl: (6) Could not resolve host: file-examples-com.github.io
The linux docker image is used (aspnet:5.0-alpine3.13) host OS is Windows 10 Pro.
I've tried to disable firewall on the host machine - no difference, same error message.