diff --git a/docker/dockerfiles/artifacts/artifact.Dockerfile b/docker/dockerfiles/artifacts/artifact.Dockerfile index 4be208a4f50b1..da4166df8ac57 100644 --- a/docker/dockerfiles/artifacts/artifact.Dockerfile +++ b/docker/dockerfiles/artifacts/artifact.Dockerfile @@ -40,6 +40,19 @@ COPY . /build/starrocks WORKDIR /build/starrocks RUN --mount=type=cache,target=/root/.m2/ STARROCKS_VERSION=${RELEASE_VERSION} BUILD_TYPE=${BUILD_TYPE} MAVEN_OPTS=${MAVEN_OPTS} ./build.sh --be --use-staros --clean -j `nproc` +FROM ubuntu:22.04 as datadog-downloader + +RUN apt-get update -y && apt-get install -y --no-install-recommends wget tar xz-utils + +# download the latest dd-java-agent +ADD 'https://dtdg.co/latest-java-tracer' /datadog/dd-java-agent.jar + +# Get ddprof for BE profiling +RUN imagearch=$(arch | sed 's/aarch64/arm64/; s/x86_64/amd64/') \ + && wget --no-check-certificate "https://github.com/DataDog/ddprof/releases/download/v0.15.3/ddprof-0.15.3-${imagearch}-linux.tar.xz" -O ddprof-linux.tar.xz \ + && tar xvf ddprof-linux.tar.xz && mkdir -p /datadog/ \ + && mv ddprof/bin/ddprof /datadog/ \ + && chmod 755 /datadog/ddprof FROM busybox:latest ARG RELEASE_VERSION @@ -51,4 +64,7 @@ COPY --from=fe-builder /build/starrocks/output /release/fe_artifacts COPY --from=be-builder /build/starrocks/output /release/be_artifacts COPY --from=broker-builder /build/starrocks/fs_brokers/apache_hdfs_broker/output /release/broker_artifacts +COPY --from=datadog-downloader /datadog/dd-java-agent.jar /release/fe_artifacts/fe/datadog/dd-java-agent.jar +COPY --from=datadog-downloader /datadog/ddprof /release/be_artifacts/be/datadog/ddprof + WORKDIR /release