mirror of
https://git.koehn.com/docker/postgres-wal-g.git
synced 2026-11-25 17:43:20 -06:00
Compare commits
58
Commits
v1.1-8
...
16.0-v2.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2509a90e5e | ||
|
|
e21c44f8cc | ||
|
|
97d2c06256 | ||
|
|
9330274a80 | ||
|
|
9e3a846dc1 | ||
|
|
ff60201d72 | ||
|
|
17c6ecb0d7 | ||
|
|
f888c65103 | ||
|
|
2dbb67d57d | ||
|
|
4821a6be85 | ||
|
|
b4004f97e1 | ||
|
|
d21915e04f | ||
|
|
b1025bf7be | ||
|
|
f49433d3ee | ||
|
|
53618b8e55 | ||
|
|
179daa3d14 | ||
|
|
7fe34cd27c | ||
|
|
7b1cc24f2e | ||
|
|
66d4b429cf | ||
|
|
8d201da1a2 | ||
|
|
226ba8b2d0 | ||
|
|
93013a5b39 | ||
|
|
20b012a6a0 | ||
|
|
83fa1e24a6 | ||
|
|
36f146a58f | ||
|
|
caf5c50aa6 | ||
|
|
c0dabcc230 | ||
|
|
192afe1453 | ||
|
|
69f99303d4 | ||
|
|
ef80955920 | ||
|
|
2ae1d24f9a | ||
|
|
2b8df13fda | ||
|
|
c1346e5f41 | ||
|
|
2f98080099 | ||
|
|
acadcd0db6 | ||
|
|
0670df99dc | ||
|
|
9af7b9169d | ||
|
|
f2fa1d42d6 | ||
|
|
4666db46fc | ||
|
|
6565723c06 | ||
|
|
a4ca8d4b45 | ||
|
|
25642d5ed8 | ||
|
|
ac557f48c2 | ||
|
|
9fdba2423e | ||
|
|
3adadf55b3 | ||
|
|
5b3cd141cb | ||
|
|
2f6dc3a509 | ||
|
|
21c53dc4dd | ||
|
|
f2ef1c9d00 | ||
|
|
4b02d05230 | ||
|
|
2d1dea3953 | ||
|
|
7936f2a660 | ||
|
|
f884fca8d3 | ||
|
|
808d390383 | ||
|
|
888a8e06bf | ||
|
|
8e6481be9b | ||
|
|
bd622797b1 | ||
|
|
a8028d9962 |
No files matched your search
@@ -0,0 +1,44 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get Postgres and WAL-G versions
|
||||
env:
|
||||
TAG: ${{ gitea.ref_name }}
|
||||
id: versions
|
||||
run: |
|
||||
echo "::set-output name=postrgres::${TAG:0:4}"
|
||||
echo "::set-output name=walg::${TAG:5:6}"
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.koehn.com
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
build-args: |
|
||||
BASE="${{ steps.versions.outputs.postgres }}"
|
||||
WAL_G="${{ steps.versions.outpus.walg }}"
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: git.koehn.com/docker/fetchurl:latest
|
||||
@@ -1,29 +0,0 @@
|
||||
stages:
|
||||
- build
|
||||
|
||||
build:
|
||||
stage: build
|
||||
image:
|
||||
name: moby/buildkit:latest
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- |
|
||||
buildkitd
|
||||
mkdir /root/.docker
|
||||
cat > /root/.docker/config.json <<EOF
|
||||
{
|
||||
"auths": {
|
||||
"https://index.docker.io/v1/": {
|
||||
"auth":"${DOCKER_AUTH}"
|
||||
},
|
||||
"${CI_REGISTRY}": {
|
||||
"username": "${CI_REGISTRY_USER}",
|
||||
"password": "${CI_REGISTRY_PASSWORD}"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
- buildctl build --frontend=dockerfile.v0 --local context=$CI_PROJECT_DIR --local dockerfile=$CI_PROJECT_DIR --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
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
pipeline:
|
||||
build-image:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
when:
|
||||
event: tag
|
||||
secrets: [ docker_username, docker_password ]
|
||||
settings:
|
||||
repo: koehn/postgres-wal-g
|
||||
tag: ${CI_COMMIT_TAG}
|
||||
platforms: linux/amd64
|
||||
mtu: 1300
|
||||
build_args:
|
||||
- BASE=${CI_COMMIT_TAG:0:4}
|
||||
- WALG_RELEASE=${CI_COMMIT_TAG:5:6}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
when:
|
||||
event: cron
|
||||
cron: "check-base-image"
|
||||
|
||||
pipeline:
|
||||
check-if-base-image-changed:
|
||||
image: git.koehn.com/docker/postgres-wal-g-build-checker:v0.0.1
|
||||
settings:
|
||||
base: postgres:15.2
|
||||
image: koehn/postgres-wal-g
|
||||
platforms: linux/amd64
|
||||
failure: ignore
|
||||
|
||||
build:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
group: rebuild
|
||||
secrets: [docker_username, docker_password]
|
||||
settings:
|
||||
repo: koehn/postgres-wal-g
|
||||
platforms: linux/amd64
|
||||
when:
|
||||
status: [ failure ]
|
||||
|
||||
notify:
|
||||
image: plugins/matrix
|
||||
secrets: [matrix_password, matrix_accesstoken]
|
||||
group: rebuild
|
||||
settings:
|
||||
homeserver: https://koehn.com
|
||||
roomid: "!SxdrFDKduRfxciYhEc:koehn.com"
|
||||
username: woodpecker
|
||||
password:
|
||||
from_secret: matrix_password
|
||||
accesstoken:
|
||||
from_secret: matrix_accesstoken
|
||||
template: "The postgres-wal-g image is out of date and needs to be rebuilt."
|
||||
when:
|
||||
status: [ failure ]
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
ARG BASE
|
||||
ARG BASE=latest
|
||||
|
||||
FROM golang:1.15 as build
|
||||
FROM golang:1 as build
|
||||
|
||||
ARG WALG_RELEASE=v1.0
|
||||
ARG WALG_RELEASE=master
|
||||
|
||||
RUN apt-get update -qq && apt-get install -qqy --no-install-recommends --no-install-suggests cmake liblzo2-dev libsodium23 && \
|
||||
RUN apt-get update && apt-get install -qqy --no-install-recommends --no-install-suggests cmake liblzo2-dev libsodium23 libsodium-dev && \
|
||||
cd /go/src/ && \
|
||||
git clone -b $WALG_RELEASE --recurse-submodules https://github.com/wal-g/wal-g.git && \
|
||||
cd wal-g && \
|
||||
@@ -15,7 +15,7 @@ FROM postgres:$BASE
|
||||
|
||||
|
||||
RUN export DEBIAN_FRONTEND=noninteractive && \
|
||||
apt-get update -qq && \
|
||||
apt-get update && \
|
||||
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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
[](https://woodpecker.koehn.com/docker/postgres-wal-g)
|
||||
|
||||
# Postgres WAL-G
|
||||
|
||||
This image extends the stock [Postgres Image](https://hub.docker.com/_/postgres/)
|
||||
and adds [WAL-G](https://github.com/wal-g/wal-g) support, along with some
|
||||
helpful scripts. It allows you to simply and easily create continuous
|
||||
helpful scripts. It allows you to simply and easily create continuous, encrypted
|
||||
archives of Postgres databases in S3-compatible storage.
|
||||
|
||||
## Environment
|
||||
@@ -12,8 +14,9 @@ compatible provider, and set a few environment variables:
|
||||
* `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` that can read/write files
|
||||
to your bucket
|
||||
* `AWS_ENDPOINT` (et al) to tell WAL-G where to archive (see
|
||||
[WAL-G documentation](https://github.com/wal-g/wal-g) for details)
|
||||
[WAL-G documentation](https://github.com/wal-g/wal-g/blob/master/docs/PostgreSQL.md) for details)
|
||||
* `WALG_S3_PREFIX` to tell WAL-G which bucket and prefix you'd like to use
|
||||
* `WALG_LIBSODIUM_KEY` to encrypt the files stored in S3
|
||||
|
||||
## Configuration
|
||||
In your `/var/lib/postgresql/data/pgsql/postgresql.conf` file, set your [archive
|
||||
@@ -28,7 +31,7 @@ To run a full backup, simply run `/wal-g/backup.sh`.
|
||||
## Continuous Backups
|
||||
These will happen automatically once you've started Postgres with your edited
|
||||
`postgresql.conf` file (see
|
||||
[Configuration](https://gitlab.koehn.com/docker/postgres-wal-g#configuration), above).
|
||||
[Configuration](#configuration), above).
|
||||
|
||||
## Recovery
|
||||
Testing recovery is simple: run a new Docker container with the correct
|
||||
@@ -44,5 +47,4 @@ 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 13, but you can build for whatever version you'd like. Be advised that 9.6 is the
|
||||
earliest version that WAL-G supports.
|
||||
Currently I build for Postgres 15, but you can build for whatever version that wal-g supports.
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
set -e
|
||||
|
||||
REV=$1
|
||||
# e.g., 14.3
|
||||
PG_VERSION=$1
|
||||
|
||||
#e.g., v2.0.1
|
||||
WALG_VERSION=$2
|
||||
IMAGE_NAME=koehn/postgres-wal-g
|
||||
|
||||
build_image() {
|
||||
BASE=$1
|
||||
IMAGE=$IMAGE_NAME:$BASE-$REV
|
||||
|
||||
docker build --pull -t "$IMAGE" --build-arg BASE=$BASE .
|
||||
docker push $IMAGE
|
||||
IMAGE=$IMAGE_NAME:$BASE-$WALG_VERSION
|
||||
docker buildx build -t $IMAGE --push . --build-arg BASE=$PG_VERSION --build-arg WALG_RELEASE=$WALG_VERSION --ulimit memlock=16384:16384 --platform linux/amd64,linux/arm64
|
||||
}
|
||||
|
||||
build_image "11.1" "$REV"
|
||||
build_image "9.6"
|
||||
build_image "$PG_VERSION" "$WALG_VERSION"
|
||||
|
||||
wait
|
||||
Reference in new issue
Block a user