uname -r
yum update
yum install -y yum-utils device-mapper-persistent-data lvm2
yum list docker-ce --showduplicates | sort -r
yum install docker-ce-18.06.3.ce-3.el7
systemctl start docker
systemctl enable docker
docker version
cd /etc/docker
touch daemon.json
vim daemon.json
{"registry-mirrors":["https//registry.docker-cn.com"]
}
systemctl daemon-reload
systemctl restart docker
docker search postgres
docker pull postgres:10
docker volume reate pgdata
docker run --name pgsql -v pgdata:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:10
--name 命名镜像实例
-v 持久化挂载 (宿主机目录: 容器目录)
-e 环境变量参数
-p 端口映射 (宿主机端口: 容器端口)
docker ps