Skip to content

Commit 1953aa2

Browse files
George Shiqi WuLakshSingla
authored andcommitted
Fix dockerfile for druid image (#15264)
Fixes docker image build issues with apache/druid.
1 parent 283529f commit 1953aa2

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

distribution/docker/Dockerfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
ARG JDK_VERSION=11
20+
ARG JDK_VERSION=17
2121

2222
# The platform is explicitly specified as x64 to build the Druid distribution.
2323
# This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012
@@ -49,17 +49,8 @@ RUN --mount=type=cache,target=/root/.m2 VERSION=$(mvn -B -q org.apache.maven.plu
4949
&& tar -zxf ./distribution/target/apache-druid-${VERSION}-bin.tar.gz -C /opt \
5050
&& mv /opt/apache-druid-${VERSION} /opt/druid
5151

52-
FROM busybox:1.34.1-glibc as busybox
53-
54-
FROM gcr.io/distroless/java$JDK_VERSION-debian11
55-
LABEL maintainer="Apache Druid Developers <dev@druid.apache.org>"
56-
57-
COPY --from=busybox /bin/busybox /busybox/busybox
58-
RUN ["/busybox/busybox", "--install", "/bin"]
59-
60-
# Predefined builtin arg, see: https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
52+
FROM alpine:3 as bash-static
6153
ARG TARGETARCH
62-
6354
#
6455
# Download bash-static binary to execute scripts that require bash.
6556
# Although bash-static supports multiple platforms, but there's no need for us to support all those platform, amd64 and arm64 are enough.
@@ -73,12 +64,24 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
7364
echo "Unsupported architecture ($TARGETARCH)" && exit 1; \
7465
fi; \
7566
echo "Downloading bash-static from ${BASH_URL}" \
76-
&& wget ${BASH_URL} -O /bin/bash \
77-
&& chmod 755 /bin/bash
67+
&& wget ${BASH_URL} -O /bin/bash
68+
69+
FROM busybox:1.35.0-glibc as busybox
70+
71+
FROM gcr.io/distroless/java$JDK_VERSION-debian12
72+
LABEL maintainer="Apache Druid Developers <dev@druid.apache.org>"
73+
74+
COPY --from=busybox /bin/busybox /busybox/busybox
75+
RUN ["/busybox/busybox", "--install", "/bin"]
76+
7877

7978
RUN addgroup -S -g 1000 druid \
8079
&& adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid
8180

81+
82+
COPY --from=bash-static /bin/bash /bin/bash
83+
RUN chmod 755 /bin/bash
84+
8285
COPY --chown=druid:druid --from=builder /opt /opt
8386
COPY distribution/docker/druid.sh /druid.sh
8487
COPY distribution/docker/peon.sh /peon.sh

0 commit comments

Comments
 (0)