11# syntax=docker/dockerfile:1.5-labs
2+ ARG ubuntu_release=focal
23ARG postgresql_major=15
34ARG postgresql_release=${postgresql_major}.1
45
@@ -41,8 +42,9 @@ ARG wal_g_release=2.0.1
4142# ###################
4243# Setup Postgres PPA
4344# ###################
44- FROM ubuntu:focal as ppa
45+ FROM ubuntu:${ubuntu_release} as ppa
4546# Redeclare args for use in subsequent stages
47+ ARG ubuntu_release
4648ARG postgresql_major
4749RUN apt-get update && apt-get install -y --no-install-recommends \
4850 gnupg \
@@ -51,7 +53,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5153# Add Postgres PPA
5254ARG postgresql_gpg_key=B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
5355RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "${postgresql_gpg_key}" && \
54- echo "deb https://apt-archive.postgresql.org/pub/repos/apt focal -pgdg-archive main" > /etc/apt/sources.list.d/pgdg.list
56+ echo "deb https://apt-archive.postgresql.org/pub/repos/apt ${ubuntu_release} -pgdg-archive main" > /etc/apt/sources.list.d/pgdg.list
5557
5658# ###################
5759# Download pre-built postgres
@@ -75,9 +77,10 @@ RUN mv /var/cache/apt/archives/*.deb /tmp/
7577# ###################
7678# Install postgres
7779# ###################
78- FROM ubuntu:focal as base
80+ FROM ubuntu:${ubuntu_release} as base
7981# Redeclare args for use in subsequent stages
8082ARG TARGETARCH
83+ ARG ubuntu_release
8184ARG postgresql_major
8285
8386# Install postgres
@@ -691,7 +694,7 @@ FROM base as pgroonga
691694# Latest available is 3.0.3
692695ARG pgroonga_release
693696# Download pre-built packages
694- ADD "https://packages.groonga.org/ubuntu/groonga-apt-source-latest-focal .deb" /tmp/source.deb
697+ ADD "https://packages.groonga.org/ubuntu/groonga-apt-source-latest-${ubuntu_release} .deb" /tmp/source.deb
695698RUN apt-get update && apt-get install -y --no-install-recommends \
696699 ca-certificates \
697700 /tmp/source.deb \
@@ -854,7 +857,7 @@ COPY --from=supautils /tmp/*.deb /tmp/
854857# ###################
855858# Download gosu for easy step-down from root
856859# ###################
857- FROM ubuntu:focal as gosu
860+ FROM ubuntu:${ubuntu_release} as gosu
858861ARG TARGETARCH
859862# Install dependencies
860863RUN apt-get update && apt-get install -y --no-install-recommends \
0 commit comments