Docker and CI/CD · Middle · Question 3 of 75

Why combine apt-get update and apt-get install in one RUN?

Explanation

If update is its own cached layer, a later change to the install line reuses an old package index. Also clean /var/lib/apt/lists in the same RUN.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 3

Test yourself

Take the Docker and CI/CD · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz