Get the size of a Docker image before a pull?

前端 未结 4 1143
时光说笑
时光说笑 2020-12-30 18:28

How does one get the size of a Docker image before they pull it to their machine?

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 19:08

    If you really look into the docker code for pull operation, I think your answer is there. If the image of the container is not cached, then during pulling of the image, docker first collects the information about the image from the registry like number of layers, size of each layers etc. etc.

    I would refer to read this file.

    https://github.com/moxiegirl/docker/blob/master/distribution/xfer/download.go

提交回复
热议问题