From 66eb2a1dd32403405414e0986c457588d8d45609 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 2 Mar 2022 13:27:39 +0200 Subject: [PATCH] Replace zenith/build build image with zimg/* ones --- Dockerfile | 6 +++--- Dockerfile.build | 16 ---------------- docs/docker.md | 24 +++--------------------- 3 files changed, 6 insertions(+), 40 deletions(-) delete mode 100644 Dockerfile.build diff --git a/Dockerfile b/Dockerfile index dd0dba60ca..18abae5327 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # Build Postgres separately --- this layer will be rebuilt only if one of # mentioned paths will get any changes. # -FROM zenithdb/build:buster AS pg-build +FROM zimg/rust:1.56 AS pg-build WORKDIR /zenith COPY ./vendor/postgres vendor/postgres COPY ./Makefile Makefile @@ -20,7 +20,7 @@ RUN rm -rf postgres_install/build # TODO: build cargo deps as separate layer. We used cargo-chef before but that was # net time waste in a lot of cases. Copying Cargo.lock with empty lib.rs should do the work. # -FROM zenithdb/build:buster AS build +FROM zimg/rust:1.56 AS build ARG GIT_VERSION RUN if [ -z "$GIT_VERSION" ]; then echo "GIT_VERSION is reqired, use build_arg to pass it"; exit 1; fi @@ -34,7 +34,7 @@ RUN GIT_VERSION=$GIT_VERSION cargo build --release # # Copy binaries to resulting image. # -FROM debian:buster-slim +FROM debian:bullseye-slim WORKDIR /data RUN apt-get update && apt-get -yq install libreadline-dev libseccomp-dev openssl ca-certificates && \ diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index a9fd2cb0af..0000000000 --- a/Dockerfile.build +++ /dev/null @@ -1,16 +0,0 @@ -# -# Image with all the required dependencies to build https://github.com/zenithdb/zenith -# and Postgres from https://github.com/zenithdb/postgres -# Also includes some rust development and build tools. -# NB: keep in sync with rust image version in .circle/config.yml -# -FROM rust:1.56.1-slim-buster -WORKDIR /zenith - -# Install postgres and zenith build dependencies -# clang is for rocksdb -RUN apt-get update && apt-get -yq install automake libtool build-essential bison flex libreadline-dev zlib1g-dev libxml2-dev \ - libseccomp-dev pkg-config libssl-dev clang - -# Install rust tools -RUN rustup component add clippy && cargo install cargo-audit diff --git a/docs/docker.md b/docs/docker.md index 14ba2146cb..cc54d012dd 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -7,32 +7,14 @@ Currently we build two main images: - [zenithdb/zenith](https://hub.docker.com/repository/docker/zenithdb/zenith) — image with pre-built `pageserver`, `safekeeper` and `proxy` binaries and all the required runtime dependencies. Built from [/Dockerfile](/Dockerfile). - [zenithdb/compute-node](https://hub.docker.com/repository/docker/zenithdb/compute-node) — compute node image with pre-built Postgres binaries from [zenithdb/postgres](https://github.com/zenithdb/postgres). -And two intermediate images used either to reduce build time or to deliver some additional binary tools from other repos: +And additional intermediate images: -- [zenithdb/build](https://hub.docker.com/repository/docker/zenithdb/build) — image with all the dependencies required to build Zenith and compute node images. This image is based on `rust:slim-buster`, so it also has a proper `rust` environment. Built from [/Dockerfile.build](/Dockerfile.build). - [zenithdb/compute-tools](https://hub.docker.com/repository/docker/zenithdb/compute-tools) — compute node configuration management tools. ## Building pipeline 1. Image `zenithdb/compute-tools` is re-built automatically. -2. Image `zenithdb/build` is built manually. If you want to introduce any new compile time dependencies to Zenith or compute node you have to update this image as well, build it and push to Docker Hub. +2. Image `zenithdb/compute-node` is built independently in the [zenithdb/postgres](https://github.com/zenithdb/postgres) repo. -Build: -```sh -docker build -t zenithdb/build:buster -f Dockerfile.build . -``` - -Login: -```sh -docker login -``` - -Push to Docker Hub: -```sh -docker push zenithdb/build:buster -``` - -3. Image `zenithdb/compute-node` is built independently in the [zenithdb/postgres](https://github.com/zenithdb/postgres) repo. - -4. Image `zenithdb/zenith` is built in this repo after a successful `release` tests run and pushed to Docker Hub automatically. +3. Image `zenithdb/zenith` is built in this repo after a successful `release` tests run and pushed to Docker Hub automatically.