postgresql

image

start a postgres instance

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

connect to it from an application

docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres
docker run -it --rm --link some-postgres:postgres postgres psql -h postgres -U postgres
psql
docker run --name postgresql -v pgdata:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -d -p 5432:5432 postgres
原文地址:https://www.cnblogs.com/bergus/p/postgresql.html