Docker 101: Basic commands 1
In my modest opinion to start with docker, it will be appropriate to create your own environment into a VM, with some of the free options Oracle VM VirtualBox, VMware player, etc. And after that to start to get familiar with docker you can try some of these basic commands. Therefore after you install docker, and you have it running in your host, we can proceed.
This command is used to check the current containers.
To instead check the history of the containers, so stopped, cancel or created containers you can use this command.
docker ps -a
Another useful command is the command that allow you to stop any container that is currently running.
docker stop nginx
If instead we wish to remove the current container, we can just type this command to remove for example our nginx container. ,
docker rm nginx
It could be also helpful to check which images are located currently in your docker host.
As you can see, we currently have only 3 images. To remove one of these images, because you are not going to use it, you can use the below command:
Important: Before using this command, you must delete all the containers that are running using the image that you want to delete. If none of them are using this image, feel free to proceed.
docker rmi nginx