GithubHelp home page GithubHelp logo

dmillner / docker-pgautoupgrade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pgautoupgrade/docker-pgautoupgrade

0.0 0.0 0.0 65 KB

A PostgreSQL Docker container that automatically upgrades your database

Home Page: https://hub.docker.com/r/pgautoupgrade/pgautoupgrade

License: MIT License

Shell 82.30% Dockerfile 17.70%

docker-pgautoupgrade's Introduction

This is a PostgreSQL Docker container that automatically upgrades your database.

It's whole purpose in life is to automatically detect the version of PostgreSQL used in the existing PostgreSQL data directory, and automatically upgrade it (if needed) to the required version of PostgreSQL.

After this, the PostgreSQL server starts and runs as per normal.

The reason this Docker container is needed, is because the official Docker PostgreSQL container has no ability to handle version upgrades, which leaves people to figure it out manually (not great): docker-library/postgres#37

WARNING! Backup your data!

This Docker container does an in-place upgrade of the database data, so if something goes wrong you are expected to already have backups you can restore from.

How to use this container

This container is on Docker Hub:

https://hub.docker.com/r/pgautoupgrade/pgautoupgrade

To always use the latest version of PostgreSQL, use the tag latest:

pgautoupgrade/pgautoupgrade:latest

If you instead want to run a specific version of PostgreSQL then pick a matching tag on our Docker Hub. For example, to use PostgreSQL 15 you can use:

pgautoupgrade/pgautoupgrade:15-alpine3.8

For Developers

Building the container

To build the docker image, use:

$ ./build.sh

This will take a few minutes to create the "pgautoupgrade:latest" docker container, that you can use in your docker-compose.yml files.

Testing the container image

To run the tests, use:

$ ./test.sh

The test script creates an initial PostgreSQL database for Redash using an older PG version, then starts Redash using the above "automatic updating" PostgreSQL container to update the database to the latest PostgreSQL version.

It then checks that the database files were indeed updated to the newest PostgreSQL release, and outputs an obvious SUCCESS/FAILURE message for that loop.

The test runs in a loop, testing (in sequence) PostgreSQL versions 9.5, 9.6, 10.x, 11.x, 12.x, 13.x, and 14.x.

docker-pgautoupgrade's People

Contributors

justinclift 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.