diff --git a/Dockerfile-15 b/Dockerfile-15 index ce83237f2..01895db39 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -41,14 +41,26 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -RUN apt update -y && apt install -y \ + +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC + +# Pre-configure tzdata before any installations +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone && \ + apt-get update && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y \ curl \ gnupg \ lsb-release \ software-properties-common \ wget \ sudo \ - && apt clean + git \ + && apt clean && \ + rm -rf /var/lib/apt/lists/* RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -102,12 +114,6 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets -RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata - RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ diff --git a/Dockerfile-16 b/Dockerfile-16 index db5772cee..c281ccd7f 100644 --- a/Dockerfile-16 +++ b/Dockerfile-16 @@ -41,14 +41,25 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -RUN apt update -y && apt install -y \ +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC + +# Pre-configure tzdata before any installations +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone && \ + apt-get update && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y \ curl \ gnupg \ lsb-release \ software-properties-common \ wget \ sudo \ - && apt clean + git \ + && apt clean && \ + rm -rf /var/lib/apt/lists/* RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -101,13 +112,7 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets - -RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata - + RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index e22cbe67b..4e9003ace 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -3,6 +3,15 @@ # shell: | # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task + +- name: Install Git for Nix package management + become: yes + apt: + name: git + state: present + update_cache: yes + when: stage2_nix + - name: Install Postgres from nix binary cache become: yes shell: | @@ -34,6 +43,15 @@ sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" when: stage2_nix +- name: Remove Git after Nix package installations + become: yes + apt: + name: git + state: absent + autoremove: yes + purge: yes + when: stage2_nix + - name: Set ownership and permissions for /etc/ssl/private become: yes file: diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 74b94f9f9..df44de35f 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -9,6 +9,7 @@ , darwin , jq , rust-bin +, git }: let rustVersion = "1.80.0"; @@ -29,7 +30,7 @@ buildPgrxExtension_0_12_6 rec { }; nativeBuildInputs = [ pkg-config cargo ]; - buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ + buildInputs = [ openssl postgresql git ] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration