Create a Docker Container Without Running It Immediately

In this blog post, I will show you how to create a Docker container without running in after the command is completed.

Docker Run

When we use the Docker run command, in the background, Docker is running the following two command:

docker create
docker run

Docker Create

If we want to create a container without running it immediately, we can use the Docker Create command below.

docker container create --name appserver python

The command will create a container called appserver using the Python Docker image.

If I run docker ps I won’t see it because it is not running.

To start it, I will use the command below:

docker start appserver

As you can see below, the container is now running.

docker ps

Posted

in

by