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

H2O: Use the PostgreSQL project's Apt repository for libpq #9294

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
44 changes: 27 additions & 17 deletions frameworks/C/h2o/h2o.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,28 @@ FROM "ubuntu:${UBUNTU_VERSION}" AS compile

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -yqq update && \
apt-get -yqq install \
ca-certificates \
curl \
lsb-release && \
install -dm755 /usr/share/postgresql-common/pgdg && \
curl --fail -LSso /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc \
"https://www.postgresql.org/media/keys/ACCC4CF8.asc" && \
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] \
https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > \
/etc/apt/sources.list.d/pgdg.list' && \
apt-get -yqq update && \
apt-get -yqq install \
autoconf \
bison \
cmake \
curl \
flex \
g++ \
libbpfcc-dev \
libbrotli-dev \
libcap-dev \
libicu-dev \
libnuma-dev \
libreadline-dev \
libpq-dev \
libssl-dev \
libtool \
libuv1-dev \
Expand Down Expand Up @@ -57,18 +66,6 @@ RUN curl -LSs "https://github.com/x86-64/mustache-c/archive/${MUSTACHE_C_REVISIO
CFLAGS="-flto -march=native -mtune=native -O3" ./autogen.sh && \
make -j "$(nproc)" install

ARG POSTGRESQL_VERSION=a37bb7c13995b834095d9d064cad1023a6f99b10

WORKDIR /tmp/postgresql-build
RUN curl -LSs "https://github.com/postgres/postgres/archive/${POSTGRESQL_VERSION}.tar.gz" | \
tar --strip-components=1 -xz && \
CFLAGS="-flto -march=native -mtune=native -O3" ./configure \
--includedir=/usr/local/include/postgresql \
--prefix=/usr/local \
--with-ssl=openssl && \
make -j "$(nproc)" -C src/include install && \
make -j "$(nproc)" -C src/interfaces/libpq install

ARG H2O_APP_PREFIX
WORKDIR /tmp/build
COPY CMakeLists.txt ../
Expand All @@ -85,15 +82,28 @@ RUN cmake \

FROM "ubuntu:${UBUNTU_VERSION}"

ARG POSTGRESQL_VERSION=17

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -yqq update && \
apt-get -yqq install \
ca-certificates \
curl \
lsb-release && \
install -dm755 /usr/share/postgresql-common/pgdg && \
curl --fail -LSso /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc \
"https://www.postgresql.org/media/keys/ACCC4CF8.asc" && \
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] \
https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > \
/etc/apt/sources.list.d/pgdg.list' && \
apt-get -yqq update && \
apt-get -yqq install \
libnuma1 \
libyajl2
libyajl2 \
"postgresql-client-${POSTGRESQL_VERSION}"
ARG H2O_APP_PREFIX
COPY --from=compile "${H2O_APP_PREFIX}" "${H2O_APP_PREFIX}/"
COPY --from=compile /usr/local/lib/libmustache_c.so "${H2O_APP_PREFIX}/lib/"
COPY --from=compile /usr/local/lib/libpq.so.5.17 "${H2O_APP_PREFIX}/lib/libpq.so.5"
ENV LD_LIBRARY_PATH="${H2O_APP_PREFIX}/lib"
EXPOSE 8080
ARG BENCHMARK_ENV
Expand Down
Loading