Does Docker build --no-cache actually download and refresh the base image?

后端 未结 4 1853
南旧
南旧 2021-01-18 04:31

Does docker build --no-cache refresh updated remote base images or not? Documentation does not seem to specify.

4条回答
  •  抹茶落季
    2021-01-18 05:27

    Each dockerfile commands that we specify in the docker file like RUN, CMD, ADD create layers in your local system and this layers will be used by other docker images provided they too make use of same dockerfile command with same parameters.

    When we specify docker build with "--no-cache" parameter then docker will ignore the local system docker image layers that were already available in the local system where you are building the docker and it always start the build as fresh build or from scratch and the reference count for the previous layer, if any; won't be added while building this new image layer.

    You can find the layers of image by following this link Finding the layers and layer sizes for each Docker image

提交回复
热议问题