This assumes you have installed Docker on Linux and Docker is running.
A Docker image contains the code used to create a Docker container, such as creating a Nginx web server, or a mySQL server, or a home grown app, and the list goes on. In this way, an image is like a template used to create a container. An image is kind of like a virtual machine, but much more light weight, using significantly less storage a memory (containers are usually megabytes in size).
The docker container ls command will return the list of containers.
docker container ls
Which will return something like this. If the container was created but not yet started, the status of the container will be "created".
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d937372c09ab9 b939aa938add9913 "/docker-entrypoin..." 6 minutes ago Created my-container
The docker rename command can be used to rename a container. Here is how you would rename my-container to my-container-old.
docker rename my-container my-container-old
Did you find this article helpful?
If so, consider buying me a coffee over at