Need Assistance?

support@tutorialshub.in

Docker Images and Dockerfiles

RUN and Package Installation

ADVERTISEMENT
Docker Free Lesson
5 min read
ADVERTISEMENT

RUN During Image Build

RUN executes commands while the image is being built. Package installation should happen during the build rather than every time the container starts.

For Debian/Ubuntu based images, clean package lists after installation. For language ecosystems, use their lockfile-aware installation command such as npm ci, pip with a locked requirements set, or a package manager's frozen-lockfile mode.

ADVERTISEMENT