mirror of
https://git.koehn.com/docker/postgres-wal-g.git
synced 2026-11-25 17:43:20 -06:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
365ef7da9f | ||
|
|
ceb542e680 |
No files matched your search
+17
-15
@@ -1,25 +1,27 @@
|
||||
stages:
|
||||
- build
|
||||
|
||||
build-9.6:
|
||||
build:
|
||||
stage: build
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
name: gcr.io/kaniko-project/executor:debug-v0.16.0
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- echo "{\"auths\":{\"index.docker.io\":{\"username\":\"$DOCKER_LOGIN\",\"password\":\"$DOCKER_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:9.6-$CI_COMMIT_TAG --build-arg BASE=9.6 --build-arg WALG_RELEASE=$(echo $CI_COMMIT_TAG | awk -F '-' '{print $1}')
|
||||
only:
|
||||
- tags
|
||||
|
||||
build-12:
|
||||
stage: build
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- echo "{\"auths\":{\"index.docker.io\":{\"username\":\"$DOCKER_LOGIN\",\"password\":\"$DOCKER_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:12.1-$CI_COMMIT_TAG --build-arg BASE=12.1 --build-arg WALG_RELEASE=$(echo $CI_COMMIT_TAG | awk -F '-' '{print $1}')
|
||||
- |
|
||||
cat > /kaniko/.docker/config.json <<EOF
|
||||
{
|
||||
"auths": {
|
||||
"https://index.docker.io/v1/": {
|
||||
"auth":"${DOCKER_AUTH}"
|
||||
},
|
||||
"${CI_REGISTRY}": {
|
||||
"username": "${CI_REGISTRY_USER}",
|
||||
"password": "${CI_REGISTRY_PASSWORD}"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:12.2-$CI_COMMIT_TAG --build-arg BASE=12.2 --build-arg WALG_RELEASE=$(echo $CI_COMMIT_TAG | awk -F '-' '{print $1}')
|
||||
only:
|
||||
- tags
|
||||
|
||||
+2
-2
@@ -2,11 +2,11 @@ ARG BASE
|
||||
|
||||
FROM postgres:$BASE
|
||||
|
||||
ARG WALG_RELEASE=v0.2.9
|
||||
ARG WALG_RELEASE=v0.2.14
|
||||
|
||||
RUN export DEBIAN_FRONTEND=noninteractive && \
|
||||
apt-get update -qq && \
|
||||
apt-get install -qqy curl ca-certificates vim && \
|
||||
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 -
|
||||
|
||||
COPY wal-g /wal-g
|
||||
@@ -10,6 +10,7 @@ export PG_VERSION=$(ls /usr/lib/postgresql/)
|
||||
|
||||
# disable recovery mode, re-enable remote connections and archive mode
|
||||
mv $PGDATA/pg_hba.conf.orig $PGDATA/pg_hba.conf
|
||||
mv $PGDATA/postgresql.conf.orig $PGDATA/postgresql.conf
|
||||
sed -i -e 's/^archive_mode = off/archive_mode = on/' $PGDATA/postgresql.conf
|
||||
|
||||
cat <<EOF
|
||||
|
||||
+3
-1
@@ -15,7 +15,9 @@ fi
|
||||
wal-g backup-fetch $PGDATA LATEST
|
||||
|
||||
# enable recovery mode, disable remote connections and archive mode
|
||||
cp /wal-g/recovery.conf $PGDATA/
|
||||
touch $PGDATA/recovery.signal
|
||||
cp $PGDATA/postgresql.conf $PGDATA/postgresql.conf.orig
|
||||
cat /wal-g/recovery.conf >> $PGDATA/postgresql.conf
|
||||
mv $PGDATA/pg_hba.conf $PGDATA/pg_hba.conf.orig
|
||||
cp /wal-g/pg_hba.conf $PGDATA/pg_hba.conf
|
||||
sed -i -e 's/^archive_mode = on/archive_mode = off/' $PGDATA/postgresql.conf
|
||||
|
||||
Reference in new issue
Block a user