Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libpq for multi-arch build configuration #7827

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
RUN pip3 install --upgrade pip setuptools wheel

RUN wget -q https://zlib.net/fossils/zlib-1.2.13.tar.gz -O zlib.tar.gz && \
wget -q https://www.sqlite.org/2019/sqlite-src-3290000.zip -O sqlite.zip
wget -q https://www.sqlite.org/2019/sqlite-src-3290000.zip -O sqlite.zip \
wget -q https://ftp.postgresql.org/pub/source/v17.1/postgresql-17.1.tar.gz -O postgres.tar.gz

WORKDIR /opt/lightningd
COPY . /tmp/lightning
Expand Down Expand Up @@ -128,7 +129,8 @@ QEMU_LD_PREFIX=/usr/${target_host} \
HOST=${target_host} \
TARGET=${target_host_rust} \
RUSTUP_INSTALL_OPTS="--target ${target_host_rust} --default-host ${target_host_rust}" \
PKG_CONFIG_PATH="/usr/${target_host}/lib/pkgconfig"
PKG_CONFIG_PATH="/usr/${target_host}/lib/pkgconfig" \
PG_CONFIG_PATH="/usr/${target_host}/bin/pg_config"

ENV \
ZLIB_CONFIG="--prefix=${QEMU_LD_PREFIX}" \
Expand All @@ -155,11 +157,13 @@ QEMU_LD_PREFIX=/usr/${target_host} \
HOST=${target_host} \
TARGET=${target_host_rust} \
RUSTUP_INSTALL_OPTS="--target ${target_host_rust} --default-host ${target_host_rust}" \
PKG_CONFIG_PATH="/usr/${target_host}/lib/pkgconfig"
PKG_CONFIG_PATH="/usr/${target_host}/lib/pkgconfig" \
PG_CONFIG_PATH="/usr/${target_host}/bin/pg_config"

ENV \
ZLIB_CONFIG="--prefix=${QEMU_LD_PREFIX}" \
SQLITE_CONFIG="--host=${target_host} --prefix=$QEMU_LD_PREFIX"
SQLITE_CONFIG="--host=${target_host} --prefix=$QEMU_LD_PREFIX" \
POSTGRES_CONFIG="--without-readline --prefix=${QEMU_LD_PREFIX}"

FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder

Expand All @@ -179,6 +183,19 @@ RUN unzip sqlite.zip \
&& make \
&& make install && cd .. && rm sqlite.zip && rm -rf sqlite-*

RUN mkdir postgres && tar xvf postgres.tar.gz -C postgres --strip-components=1 \
&& cd postgres \
&& ./configure ${POSTGRES_CONFIG} \
&& cd src/include \
&& make install \
&& cd ../interfaces/libpq \
&& make install \
&& cd ../../bin/pg_config \
&& make install \
&& cd ../../../../ && \
rm postgres.tar.gz && \
rm -rf postgres

ENV RUST_PROFILE=release
ENV PATH="/root/.cargo/bin:/root/.local/bin:$PATH"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ${RUSTUP_INSTALL_OPTS}
Expand Down
Loading