@@ -63,126 +63,130 @@ COPY bitnami/timescaledb-bitnami-entrypoint.sh /opt/bitnami/scripts/postgresql/
6363
6464USER 0
6565ARG TS_VERSION
66- # RUN set -ex \
67- # && rm -v /opt/bitnami/postgresql/lib/.emptyfile \
68- # && rm -v /opt/bitnami/postgresql/share/extension/.emptyfile \
69- # && mkdir -p /var/lib/apt/lists/partial \
70- # && apt-get update \
71- # && apt-get -y install \
72- # \
73- # build-essential \
74- # libssl-dev \
75- # git \
76- # \
77- # dpkg-dev \
78- # gcc \
79- # libc-dev \
80- # make \
81- # cmake \
82- # wget \
83- # && mkdir -p /build/ \
84- # && git clone https://github.com/timescale/timescaledb /build/timescaledb \
85- # \
86- # # Build current version \
87- # && cd /build/timescaledb && rm -fr build \
88- # && git checkout ${TS_VERSION} \
89- # && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" \
90- # && cd build && make install \
91- # && cd ~ \
92- # \
93- # # Install Citus
94- # && apt-get update \
95- # && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \
96- # && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \
97- # && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \
98- # && tar -C /tmp -xvf /tmp/citus.tar.gz \
99- # && addgroup --system postgres \
100- # && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \
101- # && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \
102- # && cd /tmp/citus-${CITUS_VERSION} \
103- # && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \
104- # && make \
105- # && make install \
106- # && cd ~ \
107- # && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \
108- # \
109- # && apt-get autoremove --purge -y \
110- # \
111- # build-essential \
112- # libssl-dev \
113- # \
114- # dpkg-dev \
115- # gcc \
116- # libc-dev \
117- # make \
118- # cmake \
119- # && apt-get clean -y \
120- # && rm -rf \
121- # /build \
122- # "${HOME}/.cache" \
123- # /var/lib/apt/lists/* \
124- # /tmp/* \
125- # /var/tmp/* \
126- # \
127- # # Update shared_preload_libraries
128- # && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf
66+ RUN set -ex \
67+ && rm -v /opt/bitnami/postgresql/lib/.emptyfile \
68+ && rm -v /opt/bitnami/postgresql/share/extension/.emptyfile \
69+ && mkdir -p /var/lib/apt/lists/partial \
70+ && apt-get update \
71+ && apt-get -y install \
72+ \
73+ build-essential \
74+ libssl-dev \
75+ git \
76+ \
77+ dpkg-dev \
78+ gcc \
79+ libc-dev \
80+ make \
81+ cmake \
82+ wget \
83+ && mkdir -p /build/ \
84+ && git clone https://github.com/timescale/timescaledb /build/timescaledb \
85+ \
86+ # Build current version \
87+ && cd /build/timescaledb && rm -fr build \
88+ && git checkout ${TS_VERSION} \
89+ && ./bootstrap -DCMAKE_BUILD_TYPE=RelWithDebInfo -DREGRESS_CHECKS=OFF -DTAP_CHECKS=OFF -DGENERATE_DOWNGRADE_SCRIPT=ON -DWARNINGS_AS_ERRORS=OFF -DPROJECT_INSTALL_METHOD="docker-bitnami" \
90+ && cd build && make install \
91+ && cd ~ \
92+ \
93+ # Install Citus
94+ && apt-get update \
95+ && apt-get install -y curl liblz4-dev libzstd-dev clang libkrb5-dev libicu-dev libxslt1-dev libxml2-dev llvm-dev libcurl4-openssl-dev \
96+ && CITUS_DOWNLOAD_URL="https://github.com/citusdata/citus/archive/refs/tags/v${CITUS_VERSION}.tar.gz" \
97+ && curl -L -o /tmp/citus.tar.gz "${CITUS_DOWNLOAD_URL}" \
98+ && tar -C /tmp -xvf /tmp/citus.tar.gz \
99+ && addgroup --system postgres \
100+ && adduser --system --ingroup postgres --home /opt/bitnami/postgresql --no-create-home postgres \
101+ && chown -R postgres:postgres /tmp/citus-${CITUS_VERSION} \
102+ && cd /tmp/citus-${CITUS_VERSION} \
103+ && PATH="/opt/bitnami/postgresql/bin:$PATH" ./configure \
104+ && make \
105+ && make install \
106+ && cd ~ \
107+ && rm -rf /tmp/citus.tar.gz /tmp/citus-${CITUS_VERSION} \
108+ \
109+ && apt-get autoremove --purge -y \
110+ \
111+ build-essential \
112+ libssl-dev \
113+ \
114+ dpkg-dev \
115+ gcc \
116+ libc-dev \
117+ make \
118+ cmake \
119+ && apt-get clean -y \
120+ && rm -rf \
121+ /build \
122+ "${HOME}/.cache" \
123+ /var/lib/apt/lists/* \
124+ /tmp/* \
125+ /var/tmp/*
126+ # \
127+ # # Update shared_preload_libraries
128+ # && sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'citus,timescaledb'/g" /opt/bitnami/postgresql/conf/postgresql.conf
129129
130- # # Add PostGIS Extension
131- # ARG POSTGIS_MAJOR
132- # ARG PG_MAJOR
133- # ARG POSTGIS_VERSION
134-
135- # RUN apt-get update \
136- # && apt-get install -y lsb-release gnupg2 \
137- # && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \
138- # && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
139- # && apt-get update \
140- # && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
141- # && apt-get install -y --no-install-recommends \
142- # ca-certificates \
143- # \
144- # postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
145- # postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
146- # && rm -rf /var/lib/apt/lists/*
147-
148-
149- RUN apt-get update -y -qq --fix-missing
150- RUN apt-get install -y wget gnupg
151-
152- RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list
153- RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
154- RUN apt update
155- RUN apt-get update -y --fix-missing
156-
157- RUN apt-get install -y git
158- RUN apt-get install -y curl
159- RUN apt-get install -y clang llvm gcc make build-essential libz-dev zlib1g-dev strace libssl-dev pkg-config
160-
161- RUN apt-get install lsb-release wget software-properties-common gnupg -y
162-
163- # Try to install the dependencies one by one
164- RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 14
165-
166- # RUN apt-get install -y postgresql-15 postgresql-server-dev-15
167-
168- # # b/c why not! http://www.inanzzz.com/index.php/post/3zs5/installing-ruby-on-debian-8
169- RUN apt-get install -y libreadline-dev libgdbm-dev openssl
170- RUN mkdir ruby && \
171- cd ruby && \
172- wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz && \
173- tar xvfz ruby-2.3.0.tar.gz && \
174- cd ruby-2.3.0 && \
175- ./configure && \
176- make -j64 && \
177- make install
178- RUN gem install --no-document fpm
179-
180-
181- RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
182- ENV PATH="/home/.cargo/bin:${PATH}"
183- RUN cargo install cargo-pgrx
184- RUN cargo pgrx init \
185- --pg15=/usr/lib/postgresql/15/bin/pg_config
130+ # Add PostGIS Extension
131+ ARG POSTGIS_MAJOR
132+ ARG PG_MAJOR
133+ ARG POSTGIS_VERSION
134+
135+ RUN apt-get update \
136+ && apt-get install -y lsb-release gnupg2 \
137+ && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \
138+ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
139+ && apt-get update \
140+ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
141+ && apt-get install -y --no-install-recommends \
142+ ca-certificates \
143+ \
144+ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
145+ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
146+ && rm -rf /var/lib/apt/lists/*
147+
148+ RUN apt-get update -y -qq --fix-missing \
149+ && apt-get install -y wget gnupg \
150+ && echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main 15" >> /etc/apt/sources.list.d/pgdg.list \
151+ && echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" >> /etc/apt/sources.list \
152+ && echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \
153+ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
154+ && wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
155+ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 \
156+ && apt update \
157+ && apt-get update -y --fix-missing \
158+ && apt-get install -y git curl clang-14 llvm-14 gcc make build-essential libz-dev zlib1g-dev strace pkg-config lsb-release wget software-properties-common gnupg libreadline-dev libgdbm-dev libssl1.0-dev \
159+ && wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz \
160+ && tar -xzvf openssl-1.0.2l.tar.gz \
161+ && cd openssl-1.0.2l \
162+ && ./config \
163+ && make install \
164+ && ln -sf /usr/local/ssl/bin/openssl `which openssl` \
165+ && mkdir ruby \
166+ && cd ruby \
167+ && wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz \
168+ && tar xvfz ruby-2.3.0.tar.gz \
169+ && cd ruby-2.3.0 \
170+ && ./configure --with-openssl-dir=/usr/include/openssl-1.0 \
171+ && make -j64 \
172+ && make install \
173+ && gem install --no-document fpm
174+
175+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
176+ && export PATH="/.cargo/bin:$PATH" \
177+ && export PGRX_HOME="/.pgrx/" \
178+ && mkdir -p $PGRX_HOME \
179+ && cargo install cargo-pgrx --version 0.8.3 \
180+ && cargo pgrx init --pg15=/opt/bitnami/postgresql/bin/pg_config
181+
182+ RUN git clone https://github.com/zombodb/zombodb.git \
183+ && cd zombodb \
184+ # && sed -i 's/pgrx = "=0.8.3"/pgrx = "=0.8.3"/' Cargo.toml \
185+ && export PATH="/.cargo/bin:$PATH" && cargo pgrx install --release
186+
187+
188+ # 0 166.5 /.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.0/Cargo.toml
189+ # 0 166.5 /.cargo/registry/src/github.com-1ecc6299db9ec823/pgrx-pg-config-0.9.0/Cargo.toml
186190
187191USER 1001
188192
0 commit comments