From d13d8626af99e2fa5aab5f8648dcb29d2b7b7218 Mon Sep 17 00:00:00 2001 From: Eric Fu Date: Sun, 18 Jun 2023 00:26:47 +0800 Subject: [PATCH] feat: add debug profile tools in docker image (#10380) --- docker/Dockerfile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b412a59ba9efd..460220d662595 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,10 +1,13 @@ -FROM ubuntu:22.04 as base +FROM ubuntu:22.04 AS base ENV LANG en_US.utf8 -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install make build-essential cmake protobuf-compiler curl bash lld maven unzip libsasl2-dev +RUN apt-get update \ + && apt-get -y install ca-certificates build-essential libsasl2-dev openjdk-11-jdk -FROM base as builder +FROM base AS builder + +RUN apt-get update && apt-get -y install make cmake protobuf-compiler curl bash lld maven unzip SHELL ["/bin/bash", "-c"] @@ -32,28 +35,34 @@ RUN rustup self update \ && rustup show \ && rustup component add rustfmt -RUN cargo fetch - -RUN cargo build -p risingwave_cmd_all --release --features "rw-static-link" && \ +RUN cargo fetch && \ + cargo build -p risingwave_cmd_all --release --features "rw-static-link" && \ mkdir -p /risingwave/bin && mv /risingwave/target/release/risingwave /risingwave/bin/ && \ + cp ./target/release/build/tikv-jemalloc-sys-*/out/build/bin/jeprof /risingwave/bin/ && \ mkdir -p /risingwave/lib && cargo clean RUN cd /risingwave/java && mvn -B package -Dmaven.test.skip=true -Djava.binding.release=true && \ mkdir -p /risingwave/bin/connector-node && \ tar -zxvf /risingwave/java/connector-node/assembly/target/risingwave-connector-1.0.0.tar.gz -C /risingwave/bin/connector-node -FROM ubuntu:22.04 as image-base -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install ca-certificates openjdk-11-jdk libsasl2-dev && rm -rf /var/lib/{apt,dpkg,cache,log}/ +FROM base AS risingwave -FROM image-base as risingwave LABEL org.opencontainers.image.source https://github.com/risingwavelabs/risingwave + +RUN apt-get -y install gdb \ + && rm -rf /var/lib/{apt,dpkg,cache,log}/ + RUN mkdir -p /risingwave/bin/connector-node && mkdir -p /risingwave/lib + COPY --from=builder /risingwave/bin/risingwave /risingwave/bin/risingwave COPY --from=builder /risingwave/bin/connector-node /risingwave/bin/connector-node COPY --from=builder /risingwave/ui /risingwave/ui +COPY --from=builder /risingwave/bin/jeprof /usr/local/bin/jeprof + # Set default playground mode to docker-playground profile ENV PLAYGROUND_PROFILE docker-playground # Set default dashboard UI to local path instead of github proxy ENV RW_DASHBOARD_UI_PATH /risingwave/ui + ENTRYPOINT [ "/risingwave/bin/risingwave" ] CMD [ "playground" ]