Docker and CI/CD · Junior · Question 22 of 75
What is the difference between ARG and ENV?
- 1
ENVis only for the build, whileARGstays in the container - ✓Correct answer:
ARGexists only during the build;ENValso at runtime - 3
ARGis for numbers only, andENVis for strings
Explanation
ARG values are passed with --build-arg and vanish after the build. ENV values are stored in the image and visible to the running app. Neither is a safe place for secrets.