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
You may want to run your app as a different user with fewer privileges. The USER instruction makes this easy.
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
This simple docker file allows us to check
this by running a default command of
0:00
whoami, which prints the current user.
0:03
We can build an image from this
with docker build -t temp for
0:06
the current directory.
0:11
And if we then run it
with docker run temp,
0:13
the default command will run and
print root.
0:17
You may want to run your app as
a different user with fewer privileges.
0:22
The user instruction makes this easy.
0:26
Just insert a line with USER at the start,
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