Public | Automated Build

Last pushed: 3 years ago
Short Description
Short description is empty for this repo.
Full Description

Docker-PostgreSQL

Deploy Postgresql Server on Docker,You can build postgresql docker with this dockerfile

create a folder for postgresql data

sudo mkdir ~/pgdata  

run docker backend

docker run -d -p 5432:5432 -v ~/pgdata:/var/lib/pgsql/9.4:rw -e POSTGRESQL_USER=<Your username> -e POSTGRESQL_PASS=<Your password> -e POSTGRESQL_DB=<Database name> &   
e.g:  
sudo docker run -d -p 5432:5432 -v ~/pgdata:/var/lib/pgsql/9.4:rw -e POSTGRESQL_USER=demo -e POSTGRESQL_PASS=demo -e POSTGRESQL_DB=demo 'cloudcube/postgresql' &  

how to use?

sudo rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm  
sudo yum install postgresql94  
psql -h localhost -p 5432 -U demo -W demo  

note

-v 指定container卷存储,container的路径要和run脚本中的POSTGRESQL_DATA一致.
postgresql openssl未配置成功.

Docker Pull Command
Owner
cloudcube
Source Repository