Giter VIP home page Giter VIP logo

postgres-8.4's Introduction

docker-psql8.4

Dockerfile to build a PostgreSQL 8.4 image based on Ubuntu 10.04

Build and run

Then you have to build an image from this repository:

docker build -t unifield:psql-8.4

Now you have to run the container. But have a look to an example of what could be done:

docker run -d --name uf-psql -p 25432:5432 -e POSTGRESQL_USER=unifield -e POSTGRESQL_PASS=unifield unifield:psql-8.4

We know that:

  • it will be run in daemon (-d option)
  • PostgreSQL server is accessible on the port 25432 with the user unifield and the password unifield.
  • The name of the container will be uf-psql
  • on our machine, we use the unifield:psql8.4 docker base image to create this container (we built it previously)

And now you're running postgreSQL for Unifield.

Manage databases

To create/delete databases, you have to connect to your PostgreSQL server like this:

createdb --host=localhost --port=25432 --user=unifield <your_database>
dropdb --host=localhost --port=25432 --user=unifield <your_database>

Notes on making and using frozen databases

Bring up the database in internal data mode, listening on port 15432:

docker run -p 127.0.0.1:15432:5432 \
      -e POSTGRESQL_USER=unifield -e POSTGRESQL_TRUST=YES \
      -e POSTGRESQL_DATA=/internal \
      --name fz unifield/postgres:8.4

Modify .automafield.config.sh to have MY_POSTGRES_USERNAME=unifield and MYPORT=15432. Open a new bash window. Use pct_all_instances to confirm that you are talking to the Docker postgres. Use pct_dropall, pct_restoreall, etc.

Get a named copy of the running image like this:

ver=3.0rc2
docker stop fz
docker commit fz unifield/postgres:8.4_$ver
docker rm fz

Test it by starting it:

docker run -p 127.0.0.1:15432:5432 \
      -e POSTGRESQL_USER=unifield -e POSTGRESQL_TRUST=YES \
      -e POSTGRESQL_DATA=/internal \
      -e unifield/postgres:8.4_$ver

The databases you loaded should still be there. Drop one with pct_drop. Stop and re-start the unifield/postgres:8.4_3.0rc2 container. The missing database will be brought back to life, and any updates/inserts into the databases will be reverted.

When using docker-compose, stop and start does not revert the database. It only stops and starts an existing container made from the image. To make new containers from the base image with a clean database, use docker-compose down/up.

postgres-8.4's People

Contributors

jeffallen avatar qtheuret avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.