Thursday, 27 June 2019

Building Docker images for cache

When building a Docker image, it's useful to know that one can avoid the benefit of caching i.e. messages such as this: -


 ---> 790dcbffd65f
Step 2/3 : RUN apt-get update
 ---> Using cache
 ---> a9dadec81fda
Step 3/3 : RUN apt-get upgrade
 ---> Running in b0261d077b68
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...

This is especially useful when attempting to upgrade packages within an image, having previously built an image ...

I appreciate that I could've just deleted the existing images using docker rmi XXXXXXXX but this is a differently easier option: -

docker build --no-cache -t ubuntu -f Dockerfile .

With thanks to this: -



No comments:

Reminder - installing podman and skopeo on Ubuntu 22.04

This follows on from: - Lest I forget - how to install pip on Ubuntu I had reason to install podman  and skopeo  on an Ubuntu box: - lsb_rel...