Compare commits

...
25 Commits
Author SHA1 Message Date
Brad Koehn 653ab7a387 Merge pull request 'Configure Renovate' (#2) from renovate/configure into master
Reviewed-on: https://git.koehn.com/docker/postgres-wal-g/pulls/2
2025-02-26 17:07:45 +00:00
Renovate Bot d6f4953452 Add renovate.json 2025-02-26 17:01:19 +00:00
Brad Koehn 05c907dcee added provenance and SBOM 2024-08-20 09:09:37 -05:00
Brad Koehn a8212acfb5 lint 2024-08-20 09:09:22 -05:00
Brad Koehn 14d15c287e added extra readme 2024-08-06 17:17:04 -05:00
Brad Koehn fb913a8062 added tidy 2024-08-06 17:13:49 -05:00
Brad Koehn 52888bd104 force bookworm 2024-05-22 08:09:48 -05:00
Brad Koehn a437ca53f4 added check for enviornment variables 2024-04-23 12:37:17 -05:00
Brad Koehn 8669c7e663 more docs 2024-04-23 11:49:22 -05:00
Brad Koehn fc63329212 added documentation about testing 2024-04-23 11:26:29 -05:00
Brad Koehn 9ca1e4b2c0 removed specific builder 2024-02-08 11:47:53 -06:00
Brad Koehn e33df13659 added gnutls-bin which makes the mysteriously failing build work. 🤷‍♂️ 2024-02-08 11:47:53 -06:00
Brad Koehn 42be7c5361 Update README.md 2023-11-18 03:53:48 +00:00
Brad Koehn caa0e988b1 fixed build error 2023-11-14 14:10:55 -06:00
Brad Koehn 0283464236 gave up on multi-machine dockerx; fixed docker tag name 2023-11-10 08:11:43 -06:00
Brad Koehn 599b4a7394 setting up key for remote build 2023-11-09 16:51:32 -06:00
Brad Koehn 181d81d8b6 setting up key for remote build 2023-11-09 16:46:20 -06:00
Brad Koehn fe1d076b54 setting up key for remote build 2023-11-09 16:39:19 -06:00
Brad Koehn d644e427bf setting up key for remote build 2023-11-09 16:30:15 -06:00
Brad Koehn 2843231ba3 setting up key for remote build 2023-11-09 16:27:28 -06:00
Brad Koehn d38cf5c191 setting up key for remote build 2023-11-09 16:23:31 -06:00
Brad Koehn aab6a0cbc3 setting up key for remote build 2023-11-09 16:11:44 -06:00
Brad Koehn 3f5f137aac setting up key for remote build 2023-11-09 15:57:01 -06:00
Brad Koehn f1b9fe6c8f setting up key for remote build 2023-11-09 15:53:26 -06:00
Brad Koehn 63777d0241 setting up key for remote build 2023-11-09 15:32:22 -06:00
6 changed files with 39 additions and 26 deletions

No files matched your search

+2 -18
View File
@@ -17,18 +17,6 @@ jobs:
echo "::set-output name=postgres::${TAG:0:4}"
echo "::set-output name=walg::${TAG:5:6}"
- name: Setup deployment key
env:
KEY: ${{ secrets.SSH_KEY }}
run: |
apt-get install -y openssh-client
mkdir "$HOME/.ssh"
chmod 700 "$HOME/.ssh"
echo "$KEY" > "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
echo "k3s-sd-03.koehn.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBxtIAg5NYQJ3QLvGSDAYglixflcxOBlLyEOwwKh45Pw" > "$HOME/.ssh/known_hosts"
ssh -l root -- k3s-sd-03.koehn.com docker version
- name: Install Docker
run: curl -fsSL https://get.docker.com | sh
@@ -37,10 +25,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
append: |
- name: k3s-sd-03
endpoint: ssh://root@k3s-sd-03.koehn.com
- name: Login to Docker Hub
uses: docker/login-action@v3
@@ -51,11 +35,11 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v5
needs: versions
needs: [versions, ssh]
with:
build-args: |
BASE=${{ steps.versions.outputs.postgres }}
WAL_G=${{ steps.versions.outputs.walg }}
push: true
platforms: linux/amd64,linux/arm64
tags: git.koehn.com/docker/postgres-wal-g:${{ steps.versions.outputs.postgres }}-${{ steps.versions.outputs.walg }}
tags: git.koehn.com/docker/postgres-wal-g:${{ gitea.ref_name }}
+3 -2
View File
@@ -1,13 +1,14 @@
ARG BASE=latest
FROM golang:1 as build
FROM golang:1-bookworm AS build
ARG WALG_RELEASE=master
RUN apt-get update && apt-get install -qqy --no-install-recommends --no-install-suggests cmake liblzo2-dev libsodium23 libsodium-dev && \
RUN apt-get update && apt-get install -qqy --no-install-recommends --no-install-suggests cmake gnutls-bin 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 && \
GOBIN=/go/bin go mod tidy && \
GOBIN=/go/bin USE_LIBSODIUM=1 USE_LZO=1 make install_and_build_pg
+8 -1
View File
@@ -45,4 +45,11 @@ 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 15, but you can build for whatever version that wal-g supports.
Currently I build for Postgres 16, but you can build for whatever version that wal-g supports.
## Kubernetes Deployments and Justfile
For an example of how to use this in Kubernetes (I happen to use k3s), you can check
out my deployment of this image [here](https://git.koehn.com/k3s-home/postgres).
That link also contains a `justfile` that has some useful recipes for creating
database, creating backups, testing backups, verifying backups, etc.
+1 -1
View File
@@ -12,7 +12,7 @@ IMAGE_NAME=koehn/postgres-wal-g
build_image() {
BASE=$1
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 --builder multiarch
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 --sbom=true --provenance=true
}
build_image "$PG_VERSION" "$WALG_VERSION"
+3
View File
@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}
+22 -4
View File
@@ -9,17 +9,29 @@
# * 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."
[ -z ${AWS_ACCESS_KEY_ID+x} ] && VARS="$VARS AWS_ACCESS_KEY_ID"
[ -z ${AWS_SECRET_ACCESS_KEY+x} ] && VARS="$VARS AWS_SECRET_ACCESS_KEY"
[ -z ${AWS_ENDPOINT+x} ] && VARS="$VARS AWS_ENDPOINT"
[ -z ${AWS_REGION+x} ] && VARS="$VARS AWS_REGION"
[ -z ${WALG_S3_PREFIX+x} ] && VARS="$VARS WALG_S3_PREFIX"
[ -z ${WALG_LIBSODIUM_KEY+x} ] && VARS="$VARS WALG_LIBSODIUM_KEY"
if [ ! -z "$VARS" ] ; then
echo "The following enviornment variables must be set:$VARS"
exit 1
fi
set -e
if [ $(id -u) == "0" ] ; then
echo "this command must be run as the postgres user (\`su postgres\`)."
exit 1
fi
set -euo pipefail
if [ -z ${PGDATA+x} ]; then
echo "Setting PGDATA to /var/lib/postgresql/data/pgsql"
export PGDATA=/var/lib/postgresql/data/pgsql
fi
@@ -37,3 +49,9 @@ sed -i -e 's/^archive_mode = on/archive_mode = off/' $PGDATA/postgresql.conf
PG_VERSION=$(ls /usr/lib/postgresql/)
/usr/lib/postgresql/$PG_VERSION/bin/pg_ctl start -D $PGDATA
echo "Recovery complete. Press <return> to continue."
echo "If this is a production recovery, simply restart the container."
echo ""
echo "To test the database, disable \`archive_mode\` in $PGDATA/postgresql.conf or you risk "
echo "corrupting backups of the production instance. Then run \`postgres start\` to start the instance in test mode."