Home > Backend Development > PHP Tutorial > Install docker and docker-compose

Install docker and docker-compose

藏色散人
Release: 2023-04-07 06:56:01
forward
2771 people have browsed it

1. Uninstall the old version of Docker

sudo yum remove docker docker-common docker-selinux docker-engine
Copy after login

2. Execute the following command to install the dependent package

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Copy after login

3. In view of domestic network problems, it is strongly recommended to use domestic sources to execute the following command to add yum software Source

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Copy after login

4. Install Docker CE

sudo yum -y install docker-ce
Copy after login

5. Set up Docker CE to boot

sudo systemctl enable docker
sudo systemctl start docker
Copy after login

6. Due to domestic network problems, subsequent pulling of Docker images is very slow and intense. It is recommended to configure domestic image acceleration after installing Docker

sudo vi /etc/docker/daemon.json
{ "registry-mirrors": ["https://registry.docker-cn.com"]
}
Copy after login

7. Restart to take effect

sudo systemctl daemon-reload
sudo systemctl restart docker
Copy after login

8.Install docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Copy after login

The above is the detailed content of Install docker and docker-compose. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jikeyuan.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template