What is the ARG instruction in a Dockerfile and how does it differ from ENV?

Docker Fundamentals Medium

Docker Fundamentals — Medium

What is the ARG instruction in a Dockerfile and how does it differ from ENV?

Key points

  • ARG is for build-time variables, ENV is for runtime variables
  • ARG is only available during image build, ENV is available to running containers
  • ARG is used for passing dynamic values during build, ENV for setting environment variables

Ready to go further?

Related questions