docker入门第五节:centos安装docker
Docker CE and Docker-compose for CentOS
说明
此文档仅仅是安装的哈!
CentOS系列的安装文档放在:docs.docker.com/install/linux/dock... ,感兴趣的可以去阅读,我这里就简化一些操作。
#Uninstall old versions
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
#Install required packages.
yum install -y yum-utils device-mapper-persistent-data lvm2
#添加docker的repo源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#INSTALL DOCKER CE
Install the latest version of Docker CE
yum install -y docker-ce
Start Docker
systemctl start docker
#开机自启动
systemctl enable docker
#查看docker版本
docker --version
restart docker
systemctl restart docker
#Uninstall Docker CE
##Install Compose on Linux systems
Run this command to download the latest version of Docker Compose
curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Apply executable permissions to the binary
chmod +x /usr/local/bin/docker-compose
Optionally, install command completion for the bash and zsh shell.
Test the installation 查看docker-compose版本
docker-compose --version
#Uninstallation
Uninstall the Docker package:
yum remove docker-ce
Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
rm -rf /var/lib/docker
## To uninstall Docker Compose if you installed using curl:
rm /usr/local/bin/docker-compose
## To uninstall Docker Compose if you installed using pip
pip uninstall docker-compose
#原文引用
推荐文章: