## centos安装
# 修改配置文件 改为SELINUX=disabled
vim /etc/selinux/config
# 安装docker 测试是否安装成功
yum install docker -y
service docker start
# 配置国内镜像
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f136dbud.m.daocloud.io
# 将配置文件最后的,删除
vim /etc/docker/daemon.json
重启服务
sudo systemctl restart docker.service
好了docker已经安装好了~~
docker常见命令
docker部署
https://tech.coding-space.cn/mooc/docker.html
## ubuntu安装
# 卸载残余
apt-get -y remove docker docker-common docker-selinux docker-engine
sudo apt-get remove docker docker-engine docker.io
apt-get update
# 搜索密钥
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# 添加密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# 核对密钥
apt-key fingerprint 0EBFCD88
# 查看返回值
lsb_release -cs
安装服务
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s https://docker.mirrors.ustc.edu.cn
sudo systemctl restart docker.service
docker run -d --restart=always --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql
docker pull mongo:latest
docker run -p 27017:27017 -d --name mongo27017 mongo
参考文档
https://www.linuxidc.com/Linux/2019-03/157339.htm