ARG TAG FROM neondatabase/tmp-compute-node-merged-base-v14:$TAG as pg14 FROM neondatabase/tmp-compute-node-merged-base-v15:$TAG as pg15 FROM neondatabase/tmp-compute-node-merged-base-v16:$TAG as pg16 ######################################################################################### # # Compile and run the Neon-specific `compute_ctl` binary # ######################################################################################### FROM neondatabase/build-tools:pinned AS compute-tools ARG BUILD_TAG ENV BUILD_TAG=$BUILD_TAG USER nonroot # Copy entire project to get Cargo.* files with proper dependencies for the whole project COPY --chown=nonroot . . RUN cd compute_tools && cargo build --locked --profile release-line-debug-size-lto ######################################################################################### # # Final layer # Put it all together into the final image # ######################################################################################### FROM debian:bullseye-slim ARG TAG # Add user postgres RUN mkdir /var/db && useradd -m -d /var/db/postgres postgres && \ echo "postgres:test_console_pass" | chpasswd && \ mkdir /var/db/postgres/compute && mkdir /var/db/postgres/specs && \ mkdir /var/db/postgres/pgbouncer && \ chown -R postgres:postgres /var/db/postgres && \ chmod 0750 /var/db/postgres/compute && \ chmod 0750 /var/db/postgres/pgbouncer && \ echo '/usr/local/lib' >> /etc/ld.so.conf && /sbin/ldconfig && \ # create folder for file cache mkdir -p -m 777 /neon/cache COPY --from=pg14 --chown=postgres /usr/local/pgsql /usr/local/pgsql-v14 COPY --from=pg15 --chown=postgres /usr/local/pgsql /usr/local/pgsql-v15 COPY --from=pg16 --chown=postgres /usr/local/pgsql /usr/local/pgsql-v16 COPY --from=compute-tools --chown=postgres /home/nonroot/target/release-line-debug-size-lto/compute_ctl /usr/local/bin/compute_ctl # Install: # libreadline8 for psql # libicu67, locales for collations (including ICU and plpgsql_check) # liblz4-1 for lz4 # libossp-uuid16 for extension ossp-uuid # libgeos, libgdal, libsfcgal1, libproj and libprotobuf-c1 for PostGIS # libxml2, libxslt1.1 for xml2 # libzstd1 for zstd # libboost* for rdkit # ca-certificates for communicating with s3 by compute_ctl RUN apt update && \ apt install --no-install-recommends -y \ gdb \ libicu67 \ liblz4-1 \ libreadline8 \ libboost-iostreams1.74.0 \ libboost-regex1.74.0 \ libboost-serialization1.74.0 \ libboost-system1.74.0 \ libossp-uuid16 \ libgeos-c1v5 \ libgdal28 \ libproj19 \ libprotobuf-c1 \ libsfcgal1 \ libxml2 \ libxslt1.1 \ libzstd1 \ libcurl4-openssl-dev \ locales \ procps \ ca-certificates && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 USER postgres ENTRYPOINT ["/usr/local/bin/compute_ctl"]