Run and monitor a container

Keyboard Shortcuts

On a production server, you'll want to run the container in the background. In this video, learn how to use the -d flag to run the container as a background process, and how to use docker ps to monitor the status of running containers.

- [Instructor] On a real server,…you'll wanna run the container,…or multiple containers as background processes.…If we use Docker run with the -d flag,…it'll start the container in the background.…We still need -p to map the ports…from inside the container to our local machine,…and we'll specify the name of the image to start up.…We can use Docker ps to monitor the status…of this running container.…The output of Docker ps is usually too wide…for a single window, so I like to use the --format command…to make it a little bit easier to read.…

I prefer using table .names .image .status, and. ports,…this just customizes what output Docker ps…will send to the screen.…So that's a little bit more readable.…This tells us that this image, HelloCoreWorld…was spun up into the container called hungry_kare,…it's been up for about 40 seconds,…and it has internal port 5000 mapped to external port 5000.…

We can use Docker ps to monitor the status…of this container, or we can use Docker stop,…followed by the generated container name,…

Resume Transcript Auto-Scroll

Author

Released

9/12/2018

Learn how to deploy cross-platform ASP.NET Core applications. With the changes to ASP.NET Core that allow apps to run across Mac, Windows, and Linux, developers need to be able to choose the right deployment strategy: one that maximizes app performance and user experience. This course helps you deploy ASP.NET apps to IIS and cloud services like Azure, as well as to Linux servers and Docker containers. Follow along with Nate Barbettini as he sets up a simple project and works through these different deployment scenarios. Get practical tips and insights into the pros and cons of each deployment option. Plus, find out how Docker Hub can make it even easier to distribute your images across machines.