beginnerDockerfile Instructions & Multi-Stage Builds

What is the difference between ARG and ENV?

ARG defines a variable available only during the image build process (docker build --build-arg) and is not present in the final running container by default. ENV defines a variable baked into the image and available to every process in every container started from it, both at build time (for subsequent instructions) and at runtime. You can promote an ARG into an ENV explicitly if you need its value available at container runtime.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

What is the difference between ARG and ENV?

Next Step

Continue to Does EXPOSE actually publish a port?← Back to all Docker questions