Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Docker Tip #61: Difference between Docker Create, Start and Run

docker-tips-and-tricks.jpg

Create, start and run all sound pretty similar but they each have their own distinct roles. Here's what each of them do.

Create adds a writeable container on top of your image and sets it up for running whatever command you specified in your CMD. The container ID is reported back but it’s not started.

Start will start any stopped containers. This includes freshly created containers.

Run is a combination of create and start. It creates the container and starts it.

I’ve been using Docker since 2014 (mostly for web dev related projects) and I’ve never ran into a use case where I would want to create a container but not start it immediately.

Have you ever used create + start instead of run? Let me know below.

Free Intro to Docker Email Course

Over 5 days you'll get 1 email per day that includes video and text from the premium Dive Into Docker course. By the end of the 5 days you'll have hands on experience using Docker to serve a website.



Comments