Skip to content

Commit

Permalink
feat: add debug profile tools in docker image (#10380)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyufjh authored Jun 17, 2023
1 parent d26f4bb commit d13d862
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down Expand Up @@ -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" ]

0 comments on commit d13d862

Please sign in to comment.