Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to Docker!
You have completed Introduction to Docker!
Preview
ENV lets you set environment variables that you can use later in your Dockerfile, and they'll also be set within the environment of your running container.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
ENV lets you set environment variables
that you can use later in your Dockerfile,
0:00
and they'll be set within the environment
of your running container.
0:00
They take the form key = value.
0:04
So appDir=/app sets an environment
variable named appDIR to a value of /app.
0:07
You can have multiple ENV lines, or
0:15
you can set several variables on
the same ENV line, separated by spaces.
0:17
The latter is generally recommended,
because they can be stored and
0:23
retrieved more efficiently.
0:26
If you need a value to contain spaces,
you can surround it in quotes.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up