I used following command to clone a repo in order to use it in my docker container:
RUN git clone ssh://my.repo.com/repo
The problem is, that when building the docker container, docker does not clone the repo again, but used the cached one.
I quick-fixed it by using docker build --no-cache, but that rebuilds all the layers.
How can I rebuild a selected layer only?
In the Dockerfile:
ARG CACHEBUST=1
RUN git clone https://github.com/octocat/Hello-World.git
On the command line:
docker build -t your-image --build-arg CACHEBUST=$(date +%s)
source: https://github.com/moby/moby/issues/1996#issuecomment-185872769
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With