Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Ubuntu Docker PostgreSQL How-To

How to use zaiste/postgresql Docker container.

Docker >= 0.5.0 required.

sudo docker pull zaiste/postgresql
CONTAINER=$(sudo docker run -d zaiste/postgresql)
CONTAINER_IP=$(sudo docker inspect $CONTAINER | grep IPAddress | awk '{ print $2 }' | tr -d ',"')
psql -h $CONTAINER_IP -p 5432 -d docker -U docker -W
password for user docker:
psql (9.2.4)
Type "help" for help.

docker=# create database foo owner=docker;
CREATE DATABASE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment