Docker Containers
Creating Containers
To create a container, simply run a Docker image using the docker create command.
docker create [OPTIONS] IMAGE [COMMAND] [ARG...]
A simple example to start using this command is to run:
docker create hello-world
# Or
docker container create hello-world
The hello-world image is a minimal image to test whether your Docker installation is working correctly and whether your network connection is fine for pulling images from Docker Hub.
To verify that the container has been created, we usually use the docker ps command to list all running containers, but since the hello-world container was not actually started (it was just created), we need to use the -a or --all flag to see all containers regardless of their state (running, stopped, created, etc):
docker ps -a
# orPainless Docker - 2nd Edition
A Comprehensive Guide to Mastering Docker and its EcosystemEnroll now to unlock all content and receive all future updates for free.
Hurry! This limited time offer ends in:
To redeem this offer, copy the coupon code below and apply it at checkout:
