Skip to content

Commit

Permalink
fix: needs git in buildInputs too (#1301)
Browse files Browse the repository at this point in the history
* fix: needs git in buildInputs too

* fix: git on inputs in func

* fix: should be remove git

* fix: add git to dockerfile for clickhouse dep

* fix: non interactive tzdata

* fix: try to make timezone intall noninteractive

* fix: cleanup package installs

---------

Co-authored-by: Sam Rose <[email protected]>
  • Loading branch information
samrose and samrose authored Oct 29, 2024
1 parent e109fc6 commit 004595d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
22 changes: 14 additions & 8 deletions Dockerfile-15
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
23 changes: 14 additions & 9 deletions Dockerfile-16
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
7 changes: 4 additions & 3 deletions ansible/tasks/stage2-setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
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: Install Git for Nix package management
- name: Remove Git after Nix package installations
become: yes
apt:
name: git
state: present
update_cache: yes
state: absent
autoremove: yes
purge: yes
when: stage2_nix

- name: Set ownership and permissions for /etc/ssl/private
Expand Down
3 changes: 2 additions & 1 deletion nix/ext/wrappers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, darwin
, jq
, rust-bin
, git
}:
let
rustVersion = "1.80.0";
Expand All @@ -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
Expand Down

0 comments on commit 004595d

Please sign in to comment.