I build an image: Dockerfile:
FROM centos:7
build command:
$ docker build -t my-image:1.0 .
Now I make a second image (which is based on the original dockerfile) Dockerfile:
FROM centos:7
RUN yum install -y mysql
I build with the --no-cache option on true
$ docker build --no-cache=true -t my-image:1.1 .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM centos:7
---> 970633036444
Step 2 : xx
it seems to use the cache. And also when I try to delete my-image:1.0:
docker rmi 970633036444
Error response from daemon: conflict: unable to delete 970633036444 (cannot be forced) - image has dependent child images
What am I doing wrong?
It uses the docker centos7 image downloaded from Docker Hub.
That will always be the case, cache or no cache.
The --no-cache would apply to the directive/step after FROM.
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