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
We've created an image based on our Dockerfile for Mongodb. Now let's run a container based on that image.
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
As before,
we'll use the docker run subcommand.
0:00
Normally our terminal would be attached to
the main process on the running container.
0:01
That's MongoDB in this case, that lets
us control that process directly,
0:06
but it prevents us from running any
other commands on our docker host.
0:11
So I'm going to add the -d flag,
which stands for detach.
0:15
That way after the container launches
we'll be dropped back to the shell,
0:19
on our Docker host.
0:25
Our Docker file is set up
to expose ports 27017 and
0:26
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