Disable cache for specific RUN commands

前端 未结 7 522
暗喜
暗喜 2020-11-30 05:16

I have a few RUN commands in my Dockerfile that I would like to run with -no-cache each time I build a Docker image.

I understand the

相关标签:
7条回答
  • 2020-11-30 06:04

    the feature added a week ago.

    ARG FOO=bar
    
    FROM something
    RUN echo "this won't be affected if the value of FOO changes"
    ARG FOO
    RUN echo "this step will be executed again if the value of FOO changes"
    
    FROM something-else
    RUN echo "this won't be affected because this stage doesn't use the FOO build-arg"
    

    https://github.com/moby/moby/issues/1996#issuecomment-550020843

    0 讨论(0)
提交回复
热议问题