Will the variables set using the ENV instruction in a Dockerfile be persisted in the built image?
Experience Level: Senior
Tags: Docker
Answer
Yes. The environment variables set using ENV will persist when a container is run from the resulting image.
Related Docker job interview questions
What is the COPY instruction in Docker good for?
Docker SeniorHow can you view the values on the environment variables that were set using the ENV instruction in a Dockerfile?
Docker SeniorWhat is the ENV instruction good for in Docker?
Docker SeniorWhat is the ENTRYPOINT instruction good for in Docker?
Docker SeniorHow can you split a long RUN instruction on multiple lines in Dockerfile?
Docker Senior