1.
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2.
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.
sudo yum makecache fast
4.
sudo yum -y install docker-ce
5.
sudo systemctl start docker
6.
docker ps
7.
docker pull postgres
8.
docker images
9.
docker run --name Mr.Cheng -e POSTGRES_PASSWORD=root -p 5432:5432 -d postgres:latest
10.
docker ps
11.
docker exec -ti 字符串 bash
12.默认账户是postgres
psql -U postgres -h 127.0.0.1 -p 5432
12.
ctrl + p + q退出容器