Compare commits

..
23 Commits
Author SHA1 Message Date
Brad Koehn e5067b4257 trying buildkit 2021-11-10 15:19:27 -06:00
Brad Koehn e34430fd7e kaniko bump 2021-11-02 09:23:52 -05:00
Brad Koehn 67f8f0cb65 downgraded kaniko to avoid OOM issues 2021-10-11 08:12:53 -05:00
Brad Koehn a7020c5d4e upgrade to 14 2021-10-10 14:23:43 -05:00
Brad Koehn 99ef19d076 Update .gitlab-ci.yml 2021-08-19 21:50:00 +00:00
Brad Koehn a4118b3a0f merge from master 2021-08-12 08:44:17 -05:00
Brad Koehn 21f3485321 bump to 13.4 2021-08-12 08:42:02 -05:00
Brad Koehn 0b977ac06b Fix a typo. 2021-06-01 13:14:31 +00:00
Brad Koehn 0043e3f3a4 Update README.md archiving link. 2021-06-01 13:11:07 +00:00
Brad Koehn b5dbec4366 got build to work with v1.0 complexities. ouch 2021-05-31 10:50:39 -05:00
Brad Koehn 8af3605145 new filename 2021-05-31 09:11:18 -05:00
Brad Koehn fdb7f1c6bf upgraded wal-g to 1.0 2021-05-31 09:04:32 -05:00
Brad Koehn 6e75b71775 bump postgre 2021-05-13 08:29:22 -05:00
Brad Koehn 80706a20c7 Merge branch 'master' of ssh://gitlab.koehn.com:2201/docker/postgres-wal-g 2021-04-13 15:16:59 -05:00
Brad Koehn 1ca880cf44 bump kaniko 2021-04-13 15:16:47 -05:00
Brad Koehn b66f2886bb Update .gitlab-ci.yml file 2021-02-28 18:00:13 +00:00
Brad Koehn 55b02b6caa wal-g version bump 2020-11-30 08:40:27 -06:00
Brad Koehn 3160eaf1b6 upgrade to pg13.1 2020-11-18 11:14:21 -06:00
Brad Koehn ae5912f70f upgrade to pg13.1 2020-11-18 10:10:36 -06:00
Brad Koehn f648887066 merged 2020-10-12 11:53:57 -05:00
Brad Koehn 4a4d87ba5d added documentation 2020-10-12 10:04:15 -05:00
Brad Koehn 7fa04795a8 Update README.md 2020-09-26 17:51:52 +00:00
Brad Koehn 89f76bb78b pg 13 2020-09-26 07:40:15 -05:00
6 changed files with 39 additions and 9 deletions

No files matched your search

+3 -3
View File
@@ -4,11 +4,11 @@ stages:
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug-v0.16.0
name: moby/buildkit:latest
entrypoint: [""]
script:
- |
cat > /kaniko/.docker/config.json <<EOF
cat > /root/.docker/config.json <<EOF
{
"auths": {
"https://index.docker.io/v1/": {
@@ -21,7 +21,7 @@ build:
}
}
EOF
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:12.4-$CI_COMMIT_TAG --build-arg BASE=12.4 --build-arg WALG_RELEASE=$(echo $CI_COMMIT_TAG | awk -F '-' '{print $1}')
- buildctl build --frontend=dockerfile.v0 --local context=$CI_PROJECT_DIR --local dockerfile=$CI_PROJECT_DIR/Dockerfile --output type=image,name=docker.io/koehn/postgres-wal-g:14.0-$CI_COMMIT_TAG,push=true --opt build-arg:BASE=14.0 --opt build-arg:WALG_RELEASE=$(echo $CI_COMMIT_TAG | awk -F '-' '{print $1}')
only:
- tags
+14 -3
View File
@@ -1,12 +1,23 @@
ARG BASE
FROM golang:1.15 as build
ARG WALG_RELEASE=v1.0
RUN apt-get update -qq && apt-get install -qqy --no-install-recommends --no-install-suggests cmake liblzo2-dev libsodium23 && \
cd /go/src/ && \
git clone -b $WALG_RELEASE --recurse-submodules https://github.com/wal-g/wal-g.git && \
cd wal-g && \
GOBIN=/go/bin USE_LIBSODIUM=1 USE_LZO=1 make install_and_build_pg
FROM postgres:$BASE
ARG WALG_RELEASE=v0.2.14
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -qq && \
apt-get install -qqy curl ca-certificates libsodium23 vim && \
cd /usr/local/bin && curl -L https://github.com/wal-g/wal-g/releases/download/$WALG_RELEASE/wal-g.linux-amd64.tar.gz | tar xzf -
apt-get install -qqy curl ca-certificates libsodium23 vim
COPY --from=build /go/src/wal-g/main/pg/wal-g /usr/local/bin/wal-g
COPY wal-g /wal-g
+5
View File
@@ -0,0 +1,5 @@
FROM koehn/postgres-wal-g:13.3-v1.0-2
RUN apt-get update -qq && apt-get install -qqy --no-install-recommends postgis postgresql-13-postgis-3
+3 -3
View File
@@ -16,8 +16,8 @@ to your bucket
* `WALG_S3_PREFIX` to tell WAL-G which bucket and prefix you'd like to use
## Configuration
In your `/varlib/postgresql/data/pgsql/postgresql.conf` file, set your [archive
settings](https://www.postgresql.org/docs/9.1/continuous-archiving.html).
In your `/var/lib/postgresql/data/pgsql/postgresql.conf` file, set your [archive
settings](https://www.postgresql.org/docs/current/continuous-archiving.html).
Importantly, you should set `archive_mode = on` and
`archive_command = 'wal-g wal-push %p'`. This will
tell Postgres to have WAL-G send WAL files to S3.
@@ -44,5 +44,5 @@ If you start your recovered backup, be sure to turn `archive_mode = off` to avoi
pushing additional WAL files to S3!
## Postgres Versions
Currently I build for Postgres 9.6 and Postgres 12. Be advised that 9.6 is the
Currently I build for Postgres 13, but you can build for whatever version you'd like. Be advised that 9.6 is the
earliest version that WAL-G supports.
+2
View File
@@ -1,5 +1,7 @@
#!/bin/bash
# A simple script to push a backup of your database.
if [ -z ${PGDATA+x} ]; then
export PGDATA=/var/lib/postgresql/data/pgsql
fi
+12
View File
@@ -1,5 +1,17 @@
#!/bin/bash
# Recovery script:
# * Calls wal-g to recover the latest database
# * Configures postgres to enter recovery mode by:
# * 1. Setting signal
# * 2. Appending wal-g recovery commands onto postgresql.conf
# * 3. Configuring postgres to only allow connections from localhost, preventing concurrent updates
# * 4. Disabling archive mode so as not to corrupt S3 backups
# * Starts postgres
#
# When recovery is done, hit ^C and start database using `/docker-entrypoint.sh postgres` and you should be able to connect to the database and verify backups are OK.
# If you get an error message, DON'T PANIC! Just read the message and do what it tells you to do.
if [ $(id -u) == "0" ] ; then
echo "this command must be run as the postgres user."
exit 1