February 2019
Intermediate to advanced
240 pages
5h 25m
English
Currently, our Dockerfile has the following two lines:
| | RUN apt-get update -yqq |
| | RUN apt-get install -yqq --no-install-recommends nodejs |
Although this works, there’s a hidden problem lurking. Let’s say we come along at a later stage and realize we need to install an extra package—for example, the Vim editor. We add the vim package to the apt-get install RUN instruction, busting the cache and causing that instruction to be rerun:
| | RUN apt-get update -yqq |
| | RUN apt-get install -yqq --no-install-recommends nodejs vim |
However, the apt-get update RUN instruction remains unchanged, and the cached repository details will be used. Rather than getting the current, latest version of the new package we’ve added, ...
Read now
Unlock full access