How to install docker in Virtualbox
This article mainly introduces Virtualbox how to install docker, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Uninstall the old version of sudo yum remove docker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-engine using the repository installation
Install the yum-utils package (which provides the yum-config-manager utility) and set up a stable repository.
Sudo yum install-y yum-utils sudo yum-config-manager\-- add-repo\ https://download.docker.com/linux/centos/docker-ce.repo install the Docker engine
There will be a choice during installation. Just select y all the way to install.
Sudo yum install docker-ce docker-ce-cli containerd.io starts Dockersudo systemctl start docker
Hello-world verifies that the Docker engine is installed correctly by running the image.
Enter the command to see the list of images under docker
Sudo docker images
As shown in the figure
Docker installed successfully here
Deletion of mirror image
Docker has two deleted commands, rm and rmi
Rm Remove one or more containers
Rmi Remove one or more images
There are two different words, images and container. Images is easy to understand, which means the same as the image of a virtual machine, which is equivalent to a template, and container is the state of the images runtime. Docker keeps a state for all image that has been run (container)
First delete the container and then delete the images. You can use docker ps-a to view the container
Sudo docker ps-asudo docker stop container_id
It will appear as shown in the figure
You can't delete container until you stop it, so enter the stop command and start deleting it after you stop it.
Sudo docker rm container_idsudo docker rmi image ID (REPOSITORY) sudo docker images
When you delete using rmi, you can delete it using image ID or using the image name. After the command is completed, check the list of images. The image has been deleted.
Set docker self-starting sudo systemctl enable docker
Set up a domestic image repository
# create the file sudo mkdir-p / etc/docker#, modify the configuration, and set the image sudo tee / etc/docker/daemon.json