centos安装docker

https://www.cnblogs.com/yufeng218/p/8370670.html

1.更新yum

yum update -y

2.删除旧版

yum remove docker  docker-common docker-selinux docker-engine

3.安装依赖

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

4.设置yum源

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

5.查看docker版本

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

6.安装

sudo yum install docker-ce

7.加入开机启动

sudo systemctl start docker
sudo systemctl enable docker

8.运行

docker run --privileged=true -i -t -d -p 8632:8632 -p 2181:2181 -p 9999:9999 -p 3306:3306 -p 6379:6379 -p 27017:27017 -p 9098:9098 -p 7777:7777 -p 7091:7091 -p 8883:8883 -p 7090:7090 -p 9100-9120:9100-9120 -p 80:80 -p 8443:8443 -p 443:443 -p 8642-8690:8642-8690 -p 9000:9000 -v /Users/zhoutao/docker-data:/root/docer-data/  99509a83ca04 /usr/sbin/init

你可能感兴趣的:(centos安装docker)