Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Compose stuck downloading or pulling fs layer

I have the latest Docker for Mac installed, and I'm running into a problem where it appears that docker-compose up is stuck in a Downloading state for one of the containers:

± |master ✗| → docker-compose up --build
Pulling container (repo.io/company/container:prod)...
prod: Pulling from company/container
somehash: Already exists
somehash: Already exists
somehash: Already exists
somehash: Already exists
somehash: Pulling fs layer
somehash: Already exists
somehash: Already exists
somehash: Downloading [=================================================> ] 234.6 MB/239.3 MB
somehash: Download complete
somehash: Download complete

^^ this is literally what it looks like on my command line. Stopping and starting hasn't helped, it immediately outputs this same output.

I've tried to rm the container but I guess it doesn't yet exist, it returns the output No stopped containers. --force-recreate also gets stuck in the same place. And perhaps I'm not googling for the right terminology but I haven't found anything useful to try - any pointers?

like image 393
Hannele Avatar asked Jun 28 '16 22:06

Hannele


3 Answers

I just needed to restart Docker.

Linux users can use sudo service docker restart.

Docker for Mac has a handy button for this in the Docker widget in the macOS toolbar: Docker for Macintosh in the macOS toolbar with restart button

If you happen to be using Docker Toolkit try docker-machine restart.

like image 177
Hannele Avatar answered Oct 23 '22 06:10

Hannele


I faced the same problem! Restarting the service didn't help, downloading again didn't help. It used to get stuck at random instances leaving me with no option but to kill the pull request.

One thing which worked for me was to download 1 file at a time. For Ubuntu users, you can use the following steps:

  1. Stop the service:

    sudo service docker stop
    
  2. Start docker with max concurrent download set as 1:

    sudo dockerd --max-concurrent-downloads 1
    
  3. Download the required image:

    sudo docker pull <image_name>
    
  4. Download images, after that stop the terminal and start the daemon again as it was earlier.

    sudo service docker start
    
like image 36
Dhruva Kaku Avatar answered Oct 23 '22 07:10

Dhruva Kaku


I had the similar situation this morning where my network suddenly went down and I was forced to power cycle the modern, while docker-compose was still in the middle of downloading stuff from docker hub.

Yes, bouncing the docker daemon process seems to resolve this.

For Linux users - do sudo service docker restart to fix it.

like image 12
Samuel Toh Avatar answered Oct 23 '22 06:10

Samuel Toh