Fix dockerfile for druid image#15264
Conversation
|
@hardikbajaj - FYI |
|
I am ok moving to Java 17 based image. |
petermarshallio
left a comment
There was a problem hiding this comment.
QQ on the need for --platform
| ARG JDK_VERSION=11 | ||
| ARG JDK_VERSION=17 | ||
|
|
||
| # The platform is explicitly specified as x64 to build the Druid distribution. |
There was a problem hiding this comment.
Thank you @georgew5656! I was having real issues getting this to work on my M2 ;)
Is --platform still required here?
There was a problem hiding this comment.
i don't think this druid image actually supports multiarch images right now, when I go to the druid dockerhub i only see a amd64 image which would explain why it doesn't work on a arm based mac
There was a problem hiding this comment.
@abhishekagarwal87 do you know how this image gets built? is it a pipeline somewhere?
There was a problem hiding this comment.
it's a bit of black box for me as well. Apache infra jobs builds and pushes the image as far as I know.
There was a problem hiding this comment.
What I shoulda said (!) was I managed to build an arm Docker image using your fix - but yeah the official image would be nicer :)
There was a problem hiding this comment.
e.g. what this repo is showing https://github.com/cgiraldo/docker-hello-multiarch
There was a problem hiding this comment.
Another option might be to move the docker image building to a github action on tags only, have some action that calls the appropriate buildx command, and pushes a multi-arch image to dockerhub
There was a problem hiding this comment.
The automated dockerhub builds seem nice because then we don't have to worry about dockerhub credentials in our GHA stuff.
| RUN ["/busybox/busybox", "--install", "/bin"] | ||
|
|
||
| # Predefined builtin arg, see: https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope | ||
| FROM alpine as bash-static |
There was a problem hiding this comment.
What's the new usage of alpine for? Would it make sense to pin this to a specific version so the build is more reproducible?
There was a problem hiding this comment.
i used alpine as the layer to copy the files instead of busybox because wget is broken in busybox and alpine is a simple image to run a wget command, i can pin the image tag to something
since busybox is based on alpine i figured this was the best image to get this working without introducing a bunch of other vuln scan stuff
| ARG JDK_VERSION=11 | ||
| ARG JDK_VERSION=17 | ||
|
|
||
| # The platform is explicitly specified as x64 to build the Druid distribution. |
There was a problem hiding this comment.
I think we can raise an Infra ticket, or ask in ASF Slack, to adjust how the images get built. (Or at least ask how they get built.) If it's possible to publish ARM images too that would be nice.
| # | ||
|
|
||
| ARG JDK_VERSION=11 | ||
| ARG JDK_VERSION=17 |
There was a problem hiding this comment.
I am good with this, and in fact I prefer it 🙂
|
@LakshSingla - We may need this for 28 to build docker images. |
Fixes docker image build issues with apache/druid.
Fixes docker image build issues with apache/druid.
Fixes docker image build issues with apache/druid.


Fixes docker image build issues with apache/druid.
Description
Currently, trying to build the docker image fails with the following error when trying to grab the static bash utils.
This seems to be caused by a SSL validation issue in busybox (it seems to happen for github.com but not google.com). I thought this might be fixed by moving to busybox 1.35.0, but I got the same error.
To get this working, I moved the wget commands to another setup layer and copied the file into the distroless build.
It seems like it would be better to switch to busybox 1.35.0 anyways (there is a critical CVE: https://nvd.nist.gov/vuln/detail/CVE-2022-48174), although we technically just use the image for the setup tools, not sure if the CVE actually affects us), but the issue with switching to busybox 1.35.0 is that we get the build errors that were described in this pr: #14518
This can be remediated by also upgrading the distroless image to debian12, but there is no java11-debian12 distroless image, only a java17-debian12 image.
As far as I know druid supports java17 as a target now so maybe this would be okay? I can make that change if people think it makes sense.
I tested the new image and it ran fine.
Release note
Fix druid docker image
Key changed/added classes in this PR
distribution/docker/DockerfileThis PR has: