0

当我docker-compose pull为一个有很多服务的项目运行时,我看到这样的输出:

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

这些数字似乎有涨有跌,有时它们会同时针对多种服务进行更新。这个输出是什么意思,如何理解实际进度docker-compose pull

4

3 回答 3

0

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.

于 2020-06-30T16:24:03.140 回答
0

大多数撰写文件中都有多个服务。通常这些服务不是从本地 Dockerfile 构建的,而是引用远程存储库中的图像。每个服务由多个图像层组成。

默认情况下,adocker-compose pull将并行更新所有服务(有关更多信息,请参阅官方文档)。该百分比适用于该服务中正在下载和更新的特定层。因为一个图像可以有许多不同大小的层,所以当你使用这个命令时这个数字可能会波动。

于 2020-01-31T16:01:45.133 回答
0

它正在检索您的 docker-compose 文件服务中指定的各种 docker 映像。如果可以的话,它将为每个服务并行拉多个层,因此您可以看到每个服务的一些不同进展。

于 2020-01-31T14:32:26.133 回答