A container is a runtime instance of a docker image.
A Docker container consists of
- A Docker image
- An execution environment
- A standard set of instructions
The concept is borrowed from Shipping Containers, which define a standard to ship goods globally. Docker defines a standard to ship software.
Check docker version
List docker features
Search for the hello-world image on docker hub
docker search hello-world
Download this image from docker hub
docker pull hello-world
List the downloaded image
Create and run a container based on the hello-world image
docker run --name name-of-container hello-world
The hello-world image is build to only print information. Once finished the container stops. Later in this course we will run containers that remain active.
List the exited container
docker ps -a
Check what the argument -a does
docker ps --help
Delete the container
docker rm name-of-container
Delete the image
docker rmi hello-world