Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce docker image size by half #10506

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions distribution/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ LABEL maintainer="Apache Druid Developers <[email protected]>"
COPY --from=busybox /bin/busybox /busybox/busybox
RUN ["/busybox/busybox", "--install", "/bin"]

COPY --from=builder /opt /opt
COPY distribution/docker/druid.sh /druid.sh

RUN addgroup -S -g 1000 druid \
&& adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
&& mkdir -p /opt/druid/var \
&& chown -R druid:druid /opt \
&& chmod 775 /opt/druid/var

COPY --chown=druid:druid --from=builder /opt /opt
COPY distribution/docker/druid.sh /druid.sh

USER druid
VOLUME /opt/druid/var
WORKDIR /opt/druid
Expand Down
6 changes: 3 additions & 3 deletions distribution/docker/Dockerfile.java11
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ LABEL maintainer="Apache Druid Developers <[email protected]>"
COPY --from=busybox /bin/busybox /busybox/busybox
RUN ["/busybox/busybox", "--install", "/bin"]

COPY --from=builder /opt /opt
COPY distribution/docker/druid.sh /druid.sh

RUN addgroup -S -g 1000 druid \
&& adduser -S -u 1000 -D -H -h /opt/druid -s /bin/sh -g '' -G druid druid \
&& mkdir -p /opt/druid/var \
&& chown -R druid:druid /opt \
&& chmod 775 /opt/druid/var

COPY --chown=druid:druid --from=builder /opt /opt
COPY distribution/docker/druid.sh /druid.sh

USER druid
VOLUME /opt/druid/var
WORKDIR /opt/druid
Expand Down