$ ./guess_the_languageDevOps
DevOps · hard · #271

Why is splitting these into two RUN lines a problem?

RUN apt-get update
RUN apt-get install -y curl
  1. The image gets a second base layer
  2. apt-get cannot run twice in one build
  3. A cached, stale update can be reused
  4. curl ends up installed as non-root
If only the install line changes later, the update layer comes from cache with old package lists, so installs can fail or get outdated versions. Combine them in one RUN.
Play DevOps ▸