Define a build-time variable.
Section: Dockerfile Basics
Define build argument
dockerfile
dockerfile
ARG NODE_VERSION=20Explanation
Build args are available only during build unless copied into `ENV`.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Dockerfile Basics
Use WORKDIR instruction
Set the working directory for subsequent instructions.
Copy files into image
Copy files from the build context into the image.
Set default command
Set the default command when the container starts.