mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-03 19:42:55 +00:00
* dockerfile fix, rust cache in docker build flow * check rust cachepot * another check rust cachepot * cleanup * revert docker build to debian:buster based rust to avoid libc6 version mismatch
65 lines
1.7 KiB
Docker
65 lines
1.7 KiB
Docker
# Build Postgres
|
|
#
|
|
#FROM zimg/rust:1.56 AS pg-build
|
|
FROM zenithdb/build:buster-20220309 AS pg-build
|
|
WORKDIR /pg
|
|
|
|
USER root
|
|
|
|
COPY vendor/postgres vendor/postgres
|
|
COPY Makefile Makefile
|
|
|
|
ENV BUILD_TYPE release
|
|
RUN set -e \
|
|
&& make -j $(nproc) -s postgres \
|
|
&& rm -rf tmp_install/build \
|
|
&& tar -C tmp_install -czf /postgres_install.tar.gz .
|
|
|
|
# Build zenith binaries
|
|
#
|
|
#FROM zimg/rust:1.56 AS build
|
|
FROM zenithdb/build:buster-20220309 AS build
|
|
ARG GIT_VERSION=local
|
|
|
|
ARG CACHEPOT_BUCKET=zenith-rust-cachepot
|
|
ARG AWS_ACCESS_KEY_ID
|
|
ARG AWS_SECRET_ACCESS_KEY
|
|
#ENV RUSTC_WRAPPER cachepot
|
|
ENV RUSTC_WRAPPER /usr/local/cargo/bin/cachepot
|
|
|
|
COPY --from=pg-build /pg/tmp_install/include/postgresql/server tmp_install/include/postgresql/server
|
|
COPY . .
|
|
|
|
RUN cargo build --release
|
|
|
|
# Build final image
|
|
#
|
|
FROM debian:bullseye-slim
|
|
WORKDIR /data
|
|
|
|
RUN set -e \
|
|
&& apt-get update \
|
|
&& apt-get install -y \
|
|
libreadline-dev \
|
|
libseccomp-dev \
|
|
openssl \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
|
&& useradd -d /data zenith \
|
|
&& chown -R zenith:zenith /data
|
|
|
|
COPY --from=build --chown=zenith:zenith /home/circleci/project/target/release/pageserver /usr/local/bin
|
|
COPY --from=build --chown=zenith:zenith /home/circleci/project/target/release/safekeeper /usr/local/bin
|
|
COPY --from=build --chown=zenith:zenith /home/circleci/project/target/release/proxy /usr/local/bin
|
|
|
|
COPY --from=pg-build /pg/tmp_install/ /usr/local/
|
|
COPY --from=pg-build /postgres_install.tar.gz /data/
|
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
VOLUME ["/data"]
|
|
USER zenith
|
|
EXPOSE 6400
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
CMD ["pageserver"]
|