Skip to content

Commit bd1f4c2

Browse files
committed
chore: extract ubuntu release variable
1 parent bacf25d commit bd1f4c2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# syntax=docker/dockerfile:1.5-labs
2+
ARG ubuntu_release=focal
23
ARG postgresql_major=15
34
ARG 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
4648
ARG postgresql_major
4749
RUN 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
5254
ARG postgresql_gpg_key=B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
5355
RUN 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
8082
ARG TARGETARCH
83+
ARG ubuntu_release
8184
ARG postgresql_major
8285

8386
# Install postgres
@@ -691,7 +694,7 @@ FROM base as pgroonga
691694
# Latest available is 3.0.3
692695
ARG 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
695698
RUN 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
858861
ARG TARGETARCH
859862
# Install dependencies
860863
RUN apt-get update && apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)