CentOS 7.8 Docker安装、卸载与Docker-Compose的安装

一、CentOS 7.8 安装Docker

1.1、安装需要的软件包

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

1.12、设置yum源

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

1.13、查看仓库中的docker版本

yum list docker-ce --showduplicates | sort -r

1.14、安装docker

yum install -y docker-ce

1.5.配置源加速

mkdir -p /etc/docker
vi /etc/docker/daemon.json
{
"registry-mirrors" : [
"https://8xpk5wnt.mirror.aliyuncs.com"
]
}

1.6.设置开机自启

systemctl enable docker
systemctl daemon-reload

1.7.启动docker

sudo systemctl start docker  # 启动docker服务
 
sudo systemctl stop docker  # 停止docker服务
 
sudo systemctl restart docker  # 重启docker服务

1.8.查看docker信息

docker info
# docker 版本查看
docker -v

二、卸载

yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine docker-ce

三、安装Docker-Compose

sudo curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

#慢的话可以用这个
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version

你可能感兴趣的:(Docker,Linux,centos,docker,linux)