I am new to Docker, and I would like to list the stopped containers.
With docker ps
:
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Nothing appears, because I restarted the machine and I didn't configure them to start the containers automatically.
So when I try to run a container it says:
sudo docker run -d -p 8080:80 --name=angular_moviemasher moviemasher/angular-moviemasher
docker: Error response from daemon: Conflict. The name "/angular_moviemasher" is already in use by container b4428b708711c15233f558e70f58cb7800e23c4a6a57534abfa5818912630a37. You have to remove (or rename) that container to be able to reuse that name..
See 'docker run --help'.
So I would like to see which Docker containers are already installed and start them.
In the documentation Docker Cheat Sheet with examples I can only find an example of how to show running containers:
Info of Container
To show running Containers. With -a option, it shows running and stopped Containers.
docker ps
docker ps --help
can be your friend here and other places. Note you can also dodocker rm $(docker ps -a | grep Exit | cut -d ' ' -f 1)
to remove all Exited containers -- which will remove the conflicting name error you mention.docker container ls -a