Slow Docker on Windows Run Step, Why? Slow Docker on Windows Run Step, Why? docker docker

Slow Docker on Windows Run Step, Why?


I had face a similar issue with Docker and Windows. Tried the following options:

  1. Check if DNS is too slow. I replaced few nameserver entries in /etc/resolve.conf with 8.8.8.8 and did a force-reload. This helped reduce the load time.

  2. Check if docker is connecting to dockerd through IPv6; which is in my case wasn't the listener. Disabling IPv6 on network interfaces and rebooting the machine helped reduce the load time.


A docker build process will take quite a bit longer than running a container. It also depends on docker has cached.

So usually the first time a container is build when there is no cache it takes the longest, then subsequent docker builds the Docker Engine will use its cache if available. When you run a container it is faster once built.

When you build especially the first time docker will pull microsoft/dotnet-framework:4.7 from the public registry unless a copy is already pulled and available locally in docker images. If it is the Docker Engine will use it, if not it will put it from remote repository. If you have a local copy it is faster. You can pull it before the build if you wish or put it maybe in a local private registry and change your tag to your registry url.

Which step exactly is slow? The very last one where it is getting that nuget.exe? If so the first thing that comes to mind maybe is name resolution, DNS, firewalls, or network time outs reaching the internet.

Try to run this container to check name resolution, and see if it can get that file quickly.

FROM centos

MAINTAINER Blake Russo

RUN yum install -y dig wget bind-utils nc ; dig -x dist.nuget.org; nslookup dist.nuget.org; wget dist.nuget.org/win-x86-commandline/latest/nuget.exe; ls -la nug*;