Skip to content

Commit 019fc35

Browse files
OBSDATA-13070 Bake awscli and async-prof tools into dockerfile (#443)
Backport of 34.0.0-confluent changes to 30.0.1-confluent. Bakes AWS CLI v2 and async-profiler into the Docker image at build time instead of downloading at runtime, eliminating supply chain risk. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 431b3dc commit 019fc35

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

distribution/docker/Dockerfile

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,33 @@ RUN if [ ! -x "$(command -v ip)" ]; then \
116116
fi; \
117117
fi;
118118

119-
RUN if [ -x "$(command -v apt)" ]; then \
120-
apt update \
121-
&& apt install -y curl htop strace bind-tools netcat ; \
122-
else \
123-
apk add --no-cache curl htop strace bind-tools netcat-openbsd ; \
124-
fi;
119+
# OBSDATA-13070: Bake AWS CLI v2 and async-profiler into the image.
120+
# Shoreline notebooks previously downloaded these at runtime from the public internet
121+
# without integrity verification. Installing at build time eliminates supply chain risk.
122+
ARG AWS_CLI_VERSION=2.34.11
123+
ARG ASYNC_PROFILER_VERSION=4.3
124+
RUN set -e \
125+
&& if [ "$TARGETARCH" = "arm64" ]; then ARCH=aarch64; AP_ARCH=arm64; else ARCH=x86_64; AP_ARCH=x64; fi \
126+
&& if [ -x "$(command -v apt)" ]; then \
127+
apt-get update && apt-get install -y --no-install-recommends curl htop strace bind-tools netcat unzip \
128+
&& CLEANUP="apt-get purge -y unzip && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*"; \
129+
else \
130+
apk add --no-cache curl htop strace bind-tools netcat-openbsd unzip \
131+
&& CLEANUP="apk del unzip"; \
132+
fi \
133+
&& curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-${ARCH}-${AWS_CLI_VERSION}.zip" -o /tmp/awscli.zip \
134+
&& unzip -q /tmp/awscli.zip -d /tmp \
135+
&& /tmp/aws/install \
136+
&& rm -rf /tmp/aws /tmp/awscli.zip \
137+
&& curl -fsSL "https://github.com/async-profiler/async-profiler/releases/download/v${ASYNC_PROFILER_VERSION}/async-profiler-${ASYNC_PROFILER_VERSION}-linux-${AP_ARCH}.tar.gz" \
138+
-o /tmp/ap.tar.gz \
139+
&& mkdir -p /opt/async-profiler \
140+
&& tar xzf /tmp/ap.tar.gz -C /opt/async-profiler --strip-components=1 \
141+
&& rm /tmp/ap.tar.gz \
142+
&& ln -s /opt/async-profiler/bin/asprof /usr/local/bin/asprof \
143+
&& eval "$CLEANUP" \
144+
&& aws --version \
145+
&& asprof --version
125146

126147
USER druid
127148
VOLUME /opt/druid/var

0 commit comments

Comments
 (0)