planetp
planetp

Reputation: 16065

Understanding the output of `docker-compose pull`

When I run docker-compose pull for a project with a lot of services, I see output like this:

...
Pulling service1     ... downloading (64.0%)
Pulling service2     ... downloading (79.3%)
Pulling service3     ... downloading (64.0%)  
...

The numbers seem to go up and down and sometimes they are being updated simultaneously for multiple services. What does this output mean and how to understand the actual progress of docker-compose pull?

Upvotes: 1

Views: 2551

Answers (3)

csgeek
csgeek

Reputation: 289

Actually my experience has been that docker-compose just doesn't handle the docker layer correctly.

If you run docker inspect you'll get a list of 'Layers' when you do a docker-compose pull it fetches each of them respectively.

If you run:

docker pull ubuntu:latest

You'll get an output like this:

latest: Pulling from library/ubuntu
a4a2a29f9ba4: Pull complete
127c9761dcba: Pull complete
d13bf203e905: Pull complete
4039240d2e0b: Pull complete
Digest: sha256:35c4a2c15539c6c1e4e5fa4e554dac323ad0107d8eb5c582d6ff386b383b7dce
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest

You'll notice that there were 4 Layers that were pulled, downloaded, and extracted.

When I run docker-compose pull, assuming it needs to pull all 4 layers again, the % status just goes haywire since it's showing you the status of a specific layer, and once it's done it'll show you the status of the next one to download.

ie.

Docker:

layer1: 50%
layer2: 70%      

docker-compose output: 50%

once docker status is:

layer1: 100%
layer2: 80%  

docker-compose output: 80% (ie. i drops down from 100% to 80% since there is another layer downloading)

That being said, it's a bad user pattern and confusing but I believe that's what's going on under the hood. An actual docker-compose dev can correct me if i'm wrong.

Upvotes: 0

Wesley Rolnick
Wesley Rolnick

Reputation: 891

Most compose files have multiple services in them. Often these services are not built from a local Dockerfile, but rather reference an image in a remote repository. Each service is made up of multiple image layers.

By default a docker-compose pull will update all services in parallel (See official docs for more). The percentage is for a specific layer in that service that is being downloaded and updated. Because an image can have many layers of varying sizes this number may fluctuate when you use this command.

Upvotes: 0

Joe
Joe

Reputation: 42597

It's retrieving the various docker images specified in your docker-compose file's services. It will pull multiple layers for each service in parallel if it can, so you can see some different progress for each.

Upvotes: 1

Related Questions