Skip to content

Build a docker postgresql container from base with the option for persistence

License

Notifications You must be signed in to change notification settings

stigi/dockerfile-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerfile PostgreSQL

Info

This Dockerfile creates a container running PostgreSQL 9.2.4.

Here's what it does in particular:

  • building Postgresql using dockyard
  • exposing it on port 5432
  • initializes a database in /var/lib/postgresql/9.2/main
  • inserts a superuser in the database: docker:d0cker (change in the Dockerfile)

Install

  • docker build -t "postgresql:9.2.4" .
  • docker run -d postgresql:9.2.4

Persistance

You can mount the database directory as a volume to persist your data:

docker run -d -v $HOME/.d_volumes/postgres/:/var/lib/postgresql postgresql:9.2.4

But before you can do so you first need to create the source folder: mkdir -p $HOME/.d_volumes/postgres

Meta

Build with docker version 0.5.1

About

Build a docker postgresql container from base with the option for persistence

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages