How to prevent Dockerfile caching git clone

后端 未结 7 592
忘了有多久
忘了有多久 2020-11-30 08:19

I have a Dockerfile trying to package and deploy a web app to a container. The code of app fetches from git repository during Docker image building. Here\'s the Dockerfile s

7条回答
  •  生来不讨喜
    2020-11-30 08:49

    you can also use:

    ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
    
    RUN git reset --hard ~Whatever~
    

    as mentioned here: https://stackoverflow.com/a/58801213/8953378

提交回复
热议问题