Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install docker in Virtualbox

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 288

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report