-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix dockerfile for druid image #15264
Conversation
@hardikbajaj - FYI |
I am ok moving to Java 17 based image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QQ on the need for --platform
@@ -17,7 +17,7 @@ | |||
# under the License. | |||
# | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhishekagarwal87 do you know how this image gets built? is it a pipeline somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. what this repo is showing https://github.com/cgiraldo/docker-hello-multiarch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automated dockerhub builds seem nice because then we don't have to worry about dockerhub credentials in our GHA stuff.
distribution/docker/Dockerfile
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, TY for the explanation.
@@ -17,7 +17,7 @@ | |||
# under the License. | |||
# | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -17,7 +17,7 @@ | |||
# under the License. | |||
# | |||
|
|||
ARG JDK_VERSION=11 | |||
ARG JDK_VERSION=17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/Dockerfile
This PR has: