mysql --> mariadb --> postgresql 

官网简介 https://www.postgresql.org/

 

使用的镜像名称 centos/postgresql-96-centos7

拉取镜像 centos/postgresql-96-centos7:9.6

镜像地址: index.docker.io/centos/postgresql-96-centos7 当前版本9.6

来源(镜像来源以及说明):https://dashboard.daocloud.io/packages/4437b11b-98f8-4650-bf56-ae5eeeb36c5a

执行命令

docker run -d --name postgresql_database -e  POSTGRESQL_ADMIN_PASSWORD=123456 -v /opt/data/postgresql:/var/lib/pgsql/data -p 5432:5432 centos/postgresql-96-centos7:9.6

说明:管理员数据库postgres 管理员用户名 postgres

postgresql_database容器命名

POSTGRESQL_ADMIN_PASSWORD 管理员密码

/opt/data/postgresql宿主机存放数据库的目录 将容器内数据库目录映射到宿主机 使用存储卷 便于持久化

centos/postgresql-96-centos7:9.6是 镜像名称和版本

-p 5432:5432 将容器端口映射到宿主机端口 前面的宿主机的端口 后面的是容器内部端口 

如密码是123456

相关文档说明:

官网简介 https://www.postgresql.org/

镜像说明 https://dashboard.daocloud.io/packages/4437b11b-98f8-4650-bf56-ae5eeeb36c5a

官方镜像说明:https://hub.docker.com/_/postgres/

 

posted on 2018-01-13 22:18  余昭(Ray)  阅读(5069)  评论(2编辑  收藏  举报