arrow_back
Back

Dockerfile RUN: executing commands during build

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

RUN executes commands in a shell inside the image during the build and commits the result as a new layer.

Example:

RUN apt-get update && apt-get install -y nginx

Combine related commands into a single RUN to reduce layer count.

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Dockerfile ONBUILD: deferred build instructions

arrow_forward