How can I prevent a Dockerfile instruction from being cached?

后端 未结 3 1631
無奈伤痛
無奈伤痛 2020-12-14 00:51

In my Dockerfile I use curl or ADD to download the latest version of an archive like:

FROM debian:jessie
...
RUN apt-g         


        
3条回答
  •  不思量自难忘°
    2020-12-14 01:09

    add && exit 0 after a command will invalidate the cache from there.

    Example:

    RUN apt-get install -y unzip && exit 0

提交回复
热议问题