diff --git a/Generated/postgres/migrate-docker-entrypoint.sh b/Generated/postgres/migrate-docker-entrypoint.sh deleted file mode 100755 index 9b410d2..0000000 --- a/Generated/postgres/migrate-docker-entrypoint.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -set -Eeo pipefail -shopt -s extglob - -CURRENT_PGVERSION="" -EXPECTED_PGVERSION="$PG_MAJOR" -if [[ -f "/var/lib/postgresql/data/PG_VERSION" ]]; then - CURRENT_PGVERSION="$(cat /var/lib/postgresql/data/PG_VERSION)" -fi - -if [[ "$CURRENT_PGVERSION" != "$EXPECTED_PGVERSION" ]] && \ - [[ "$CURRENT_PGVERSION" != "" ]]; then - sed -i "s/$/ $CURRENT_PGVERSION/" /etc/apt/sources.list.d/pgdg.list - if ! apt-get update; then - echo "apt-get update failed. Are you using raspberry pi 4? If yes, please follow https://blog.samcater.com/fix-workaround-rpi4-docker-libseccomp2-docker-20/" - exit 1 - fi - if ! apt-get install -y --no-install-recommends \ - postgresql-$CURRENT_PGVERSION \ - postgresql-contrib-$CURRENT_PGVERSION; then - # On arm32, postgres doesn't ship those packages, so we download - # the binaries from an archive we built from the postgres 9.6.20 image's binaries - FALLBACK="https://aois.blob.core.windows.net/public/$CURRENT_PGVERSION-$(uname -m).tar.gz" - FALLBACK_SHARE="https://aois.blob.core.windows.net/public/share-$CURRENT_PGVERSION-$(uname -m).tar.gz" - echo "Failure to install postgresql-$CURRENT_PGVERSION and postgresql-contrib-$CURRENT_PGVERSION trying fallback $FALLBACK" - apt-get install -y wget - pushd . > /dev/null - cd /usr/lib/postgresql - wget $FALLBACK - tar -xvf *.tar.gz - rm -f *.tar.gz - cd /usr/share/postgresql - wget $FALLBACK_SHARE - tar -xvf *.tar.gz - rm -f *.tar.gz - popd > /dev/null - echo "Successfully installed PG utilities via the fallback" - fi - - export PGBINOLD="/usr/lib/postgresql/$CURRENT_PGVERSION/bin" - export PGDATABASE="/var/lib/postgresql/data" - export PGDATAOLD="/var/lib/postgresql/data/$CURRENT_PGVERSION" - export PGDATANEW="/var/lib/postgresql/data/$EXPECTED_PGVERSION" - - mkdir -p "$PGDATANEW" "$PGDATAOLD" - find "$PGDATABASE" -maxdepth 1 -mindepth 1 \ - -not -wholename "$PGDATAOLD" \ - -not -wholename "$PGDATANEW" \ - -exec mv {} "$PGDATAOLD/" \; - - chmod 700 "$PGDATAOLD" "$PGDATANEW" - chown postgres . - chown -R postgres "$PGDATAOLD" "$PGDATANEW" "$PGDATABASE" - if [ ! -s "$PGDATANEW/PG_VERSION" ]; then - PGDATA="$PGDATANEW" eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" - fi - - gosu postgres pg_upgrade - rm $PGDATANEW/*.conf - mv $PGDATANEW/* "$PGDATABASE" - mv $PGDATAOLD/*.conf "$PGDATABASE" - rm -r "$PGDATANEW" - ./delete_old_cluster.sh - rm ./analyze_new_cluster.sh -fi - -if [ -f "docker-entrypoint.sh" ]; then - exec ./docker-entrypoint.sh "$@" -else - exec docker-entrypoint.sh "$@" -fi \ No newline at end of file diff --git a/README.md b/README.md index 1df33c6..e3216e6 100644 --- a/README.md +++ b/README.md @@ -353,7 +353,7 @@ We are trying to update our dependencies to run on `arm32v7` and `x64` boards. H | nicolasdorier/ndlc-cli | 1.0.1 | [✔️](https://raw.githubusercontent.com/dgarage/ndlc/releases/1.0.1/amd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/dgarage/ndlc/releases/1.0.1/arm32v7.Dockerfile) | [✔️](https://raw.githubusercontent.com/dgarage/ndlc/releases/1.0.1/arm64v8.Dockerfile) | [Github](https://github.com/dgarage/ndlc) - [DockerHub](https://hub.docker.com/r/nicolasdorier/ndlc-cli) | | pihole/pihole | v5.7 | [✔️](https://raw.githubusercontent.com/pi-hole/docker-pi-hole/v5.7/Dockerfile) | [✔️](https://raw.githubusercontent.com/pi-hole/docker-pi-hole/v5.7/Dockerfile) | [✔️](https://raw.githubusercontent.com/pi-hole/docker-pi-hole/v5.7/Dockerfile) | [Github](https://github.com/pi-hole/docker-pi-hole) - [DockerHub](https://hub.docker.com/r/pihole/pihole) | | btcpayserver/tor | 0.4.5.9 | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Tor/0.4.5.9/Tor/0.4.5.9/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Tor/0.4.5.9/Tor/0.4.5.9/linuxarm32v7.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Tor/0.4.5.9/Tor/0.4.5.9/linuxarm64v8.Dockerfile) | [Github](https://github.com/btcpayserver/dockerfile-deps) - [DockerHub](https://hub.docker.com/r/btcpayserver/tor) | -| postgres | 13.4 | [✔️](https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile) | [✔️](https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile) | [✔️](https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile) | [Github](https://github.com/docker-library/postgres) - [DockerHub](https://hub.docker.com/_/postgres) | +| btcpayserver/postgres | 13.4 | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Postgres/13.4/Postgres/13.4/linuxamd64.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Postgres/13.4/Postgres/13.4/linuxarm32v7.Dockerfile) | [✔️](https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Postgres/13.4/Postgres/13.4/linuxarm64v8.Dockerfile) | [Github](https://github.com/btcpayserver/dockerfile-deps) - [DockerHub](https://hub.docker.com/r/btcpayserver/postgres) | | kamigawabul/docker-bitcoingold | 0.15.2 | [✔️](https://raw.githubusercontent.com/Vutov/docker-bitcoin/master/bitcoingold/0.15.2/Dockerfile) | ️❌ | ️❌ | [Github](https://github.com/Vutov/docker-bitcoin) - [DockerHub](https://hub.docker.com/r/kamigawabul/docker-bitcoingold) | | kamigawabul/btglnd | latest | [✔️](https://raw.githubusercontent.com/vutov/lnd/master/Dockerfile) | ️❌ | ️❌ | [Github](https://github.com/vutov/lnd) - [DockerHub](https://hub.docker.com/r/kamigawabul/btglnd) | | acinq/eclair | release-0.4.1 | [✔️](https://raw.githubusercontent.com/ACINQ/eclair/v0.4.1/Dockerfile) | ️❌ | ️❌ | [Github](https://github.com/ACINQ/eclair) - [DockerHub](https://hub.docker.com/r/acinq/eclair) | diff --git a/contrib/DockerFileBuildHelper/Program.cs b/contrib/DockerFileBuildHelper/Program.cs index 50650c5..47233c4 100644 --- a/contrib/DockerFileBuildHelper/Program.cs +++ b/contrib/DockerFileBuildHelper/Program.cs @@ -554,11 +554,11 @@ namespace DockerFileBuildHelper dockerInfo.GitRef = $"f1a8498333ae3ab340b5b39fbac1d7e1dc0d628c"; break; case "postgres": - dockerInfo.DockerFilePath = $"9.6/Dockerfile"; - dockerInfo.DockerFilePathARM32v7 = $"9.6/Dockerfile"; - dockerInfo.DockerFilePathARM64v8 = $"9.6/Dockerfile"; - dockerInfo.GitLink = "https://github.com/docker-library/postgres"; - dockerInfo.GitRef = $"b7cb3c6eacea93be2259381033be3cc435649369"; + dockerInfo.DockerFilePath = $"Postgres/{NoRevision(image.Tag)}/linuxamd64.Dockerfile"; + dockerInfo.DockerFilePathARM32v7 = $"Postgres/{NoRevision(image.Tag)}/linuxarm32v7.Dockerfile"; + dockerInfo.DockerFilePathARM64v8 = $"Postgres/{NoRevision(image.Tag)}/linuxarm64v8.Dockerfile"; + dockerInfo.GitLink = "https://github.com/btcpayserver/dockerfile-deps"; + dockerInfo.GitRef = $"Postgres/{image.Tag}"; dockerInfo.SupportedByUs = true; break; case "traefik": diff --git a/contrib/build-all-images.sh b/contrib/build-all-images.sh index d887e6a..2f59c90 100644 --- a/contrib/build-all-images.sh +++ b/contrib/build-all-images.sh @@ -1040,18 +1040,18 @@ cd - && cd .. # Build postgres -# https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile -DOCKERFILE="9.6/Dockerfile" -# https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile -[[ "$(uname -m)" == "armv7l" ]] && DOCKERFILE="9.6/Dockerfile" -# https://raw.githubusercontent.com/docker-library/postgres/b7cb3c6eacea93be2259381033be3cc435649369/9.6/Dockerfile -[[ "$(uname -m)" == "aarch64" ]] && DOCKERFILE="9.6/Dockerfile" -echo "Building postgres:13.4" -git clone https://github.com/docker-library/postgres postgres +# https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Postgres/13.4/Postgres/13.4/linuxamd64.Dockerfile +DOCKERFILE="Postgres/13.4/linuxamd64.Dockerfile" +# https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Postgres/13.4/Postgres/13.4/linuxarm32v7.Dockerfile +[[ "$(uname -m)" == "armv7l" ]] && DOCKERFILE="Postgres/13.4/linuxarm32v7.Dockerfile" +# https://raw.githubusercontent.com/btcpayserver/dockerfile-deps/Postgres/13.4/Postgres/13.4/linuxarm64v8.Dockerfile +[[ "$(uname -m)" == "aarch64" ]] && DOCKERFILE="Postgres/13.4/linuxarm64v8.Dockerfile" +echo "Building btcpayserver/postgres:13.4" +git clone https://github.com/btcpayserver/dockerfile-deps postgres cd postgres -git checkout b7cb3c6eacea93be2259381033be3cc435649369 +git checkout Postgres/13.4 cd "$(dirname $DOCKERFILE)" -docker build -f "$DOCKERFILE" -t "postgres:13.4" . +docker build -f "$DOCKERFILE" -t "btcpayserver/postgres:13.4" . cd - && cd .. diff --git a/docker-compose-generator/docker-fragments/postgres.yml b/docker-compose-generator/docker-fragments/postgres.yml index 9e05783..113fe8d 100644 --- a/docker-compose-generator/docker-fragments/postgres.yml +++ b/docker-compose-generator/docker-fragments/postgres.yml @@ -3,14 +3,11 @@ version: "3" services: postgres: restart: unless-stopped - image: postgres:13.4 - entrypoint: ./migrate-docker-entrypoint.sh - command: postgres + image: btcpayserver/postgres:13.4 environment: POSTGRES_HOST_AUTH_METHOD: trust volumes: - "postgres_datadir:/var/lib/postgresql/data" - - "./postgres/migrate-docker-entrypoint.sh:/migrate-docker-entrypoint.sh:ro" volumes: postgres_datadir: