You can perform various operations on docker container like add, remove, stop, and list the docker container or docker image in the system. The docker commands used in this chapter are docker specific and do not have any dependencies on Smarts product.
In docker there is nothing called uninstallation, you just need to remove the container and the image file from the system.
To remove the docker containers and the image files, you need to perform the following series of task:
-
Search for the list of container present on your system, run the following command to list the containers:
#docker ps -a
-
Run one of the following command, to attach the existing container (if any):
#docker attach <container ID> or, #docker attach <container name>
-
To stop the docker, run the following command:
-
Invoke the following command, to stop all the containers running on your machine:
#docker stop $(docker ps -a -q) #docker stop <container ID> or, #docker stop <container name>
-
-
To remove the container, run the following command:
-
Invoke the following command, to remove all the containers on your machine:
#docker rm $(docker ps -a -q) #docker rm <container ID> or, #docker rm<container name>
-
-
Search for the list of docker images present on your system, run the following command to list the docker image:
#docker images --all
-
Invoke one of the following command, to remove the image:
#docker rmi <ImageID> or, #docker rmi <Image Name>
-
Invoke one of the following command in the Docker container to exit or stop the container:
#exit Ctrl + C Ctrl + \