Disable cache for specific RUN commands

前端 未结 7 534
暗喜
暗喜 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 05:53

    Another quick hack is to write some random bytes before your command

    RUN head -c 5 /dev/random > random_bytes && 
    

    writes out 5 random bytes which will force a cache miss

提交回复
热议问题