Install docker on Linux deployment

Introduction: After learning docker, I always wanted to have a deeper understanding, so I just bought an ECS to do an experiment on it. Docker official installation URL: https://docs.docker.com/install/linux/docker-ce/centos/#upgrade-docker-ce

Docker is divided into two versions: docker CE (community version/personal version) and docker EE (enterprise version).
This time , dockerCE is installed because ECS uses the version of centOS 7.
CentOS7 installation 1.
Uninstall the old version, the old version of docker is called docker or docker-engine If these are installed, you need to uninstall them first because they have dependencies
sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest- logrotate
docker- logrotate
docker- selinux
docker-engine- selinux

docker-engine
If the yum report reports that these packages are not installed, you can install them.

【Install docker on Linux deployment】2. Install dependent packages:


sudo yum install -y yum-utils device-mapper-persistent-data lvm2

2.1. Add docker software installation package source:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

2.1.1 You can use the image address of Aliyun, and the pull image speed is faster .
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce. repo

【Install docker on Linux deployment】2.2. Update yum package index:


yum makecache fast
2.3. Install docker CE
sudo yum install docker- ce
2.4. Start docker service
systemctl start docker.service
2.5. Uninstall docker
2.5.1. Uninstall docker package, image on host, container, Volumes or custom config files are not automatically removed
sudo yum remove docker- ce
2.5.2, remove all images, containers and volumes
sudo rm -rf /var/lib/docker

docker info
container list
docker pull nginx
download image

Copyright statement: The content of this article is contributed by Alibaba Cloud real-name registered users. The copyright belongs to the original author. The Alibaba Cloud developer community does not own the copyright and does not assume the corresponding legal responsibility. For specific rules, please refer to the " Alibaba Cloud Developer Community User Service Agreement " and " Alibaba Cloud Developer Community Intellectual Property Protection Guidelines ". If you find any content suspected of plagiarism in this community, fill out the infringement complaint form to report it. Once verified, this community will delete the allegedly infringing content immediately.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00