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

[FEATURE] smaller docker images #3607

Open
sbe-arg opened this issue May 16, 2023 · 14 comments
Open

[FEATURE] smaller docker images #3607

sbe-arg opened this issue May 16, 2023 · 14 comments
Assignees
Labels
enhancement New Enhancement v3.0.0

Comments

@sbe-arg
Copy link

sbe-arg commented May 16, 2023

Is your feature request related to a problem?

images are too big, ~1.2gb each atm

What solution would you like?

variant images should be way smaller

What alternatives have you considered?

we should have an alpine variant

@sbe-arg sbe-arg added enhancement New Enhancement untriaged Issues that have not yet been triaged labels May 16, 2023
@chris-findlay
Copy link

Why do they contain a JDK rather than just a JRE?

@prudhvigodithi
Copy link
Collaborator

[Untriage]
Hey @sbe-arg can you share the images you are using? I assume you are referring OpenSearch and Dashboard?
Thank you

@prudhvigodithi prudhvigodithi transferred this issue from opensearch-project/docker-images Jun 8, 2023
@prudhvigodithi prudhvigodithi removed the untriaged Issues that have not yet been triaged label Jun 8, 2023
@peterzhuamazon
Copy link
Member

Hi @sbe-arg,
If this is about the release image of OpenSearch, then this issue can be moved to OpenSearch core.
As for ci image we will keep the JDKs.

Thanks.

@peterzhuamazon
Copy link
Member

The docker release image of OpenSearch is using the tarball created for OpenSearch, the jdk was bundled by the core, not build repo.

Thanks.

@peterzhuamazon
Copy link
Member

Hi @reta what do you think about this?
Thanks.

@reta
Copy link
Contributor

reta commented Jun 14, 2023

Hi @reta what do you think about this?

This is a good question, I am not aware of any particular reasons why we bundle JDK, not JRE (beside the fact the OpenJDK project does not provide JRE builds). I will check it out

@reta
Copy link
Contributor

reta commented Jun 20, 2023

@peterzhuamazon quick update on this one:

  • from operational perspective, OpenSearch does not need JDK, JRE seems to be sufficient
  • for OpenSearch, we provide two archive distribution types for each platform: with jdk and without jdk
  • the Docker images refer to archive distribution types with JDK bundled in
  • it seems like in scope of this issue, we could provide additional Docker images (with JRE) but that refer to archive distribution types without JDK (we could tag them appropriately)

Does it make sense to you?

@prudhvigodithi
Copy link
Collaborator

prudhvigodithi commented Jun 20, 2023

Thanks @reta.
Do we need JDK in the end distribution type? does just JRE enough to run the application ?
Also if there is no java installed it would use the default JDK in the distribution type, does just JRE enough for this?

@reta
Copy link
Contributor

reta commented Jun 20, 2023

Do we need JDK in the end distribution type? does just JRE enough to run the application ? Also if there is no java installed it would use the default JDK in the distribution type, does just JRE enough for this?

JRE is enough

@prudhvigodithi
Copy link
Collaborator

Thanks, then we should just add the JRE, this change should be part of the Core, @reta please let me know I can open an issue with some details in the OpenSearch repo.
Thanks

@reta
Copy link
Contributor

reta commented Jun 20, 2023

Thanks, then we should just add the JRE,

That could be considered a breaking change (at least for 2.x), JRE has no tooling (jcmd, jfr, ...) and we don't know if users rely on it or not.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Jun 22, 2023

This is not a high priority issue at the moment. Nor have we added the nojdk option in build repo yet.
I would suggest opening an issue as an improvement, but this is not a change that needs at the moment.

@reta do you have idea on the difference of sizes between jre and jdk? Docker images already did some compression so I would think the size is not as big.

@reta
Copy link
Contributor

reta commented Jun 22, 2023

@peterzhuamazon we have an answer here opensearch-project/OpenSearch#8195 :) ~50% less

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Jun 23, 2023

Thanks @reta,

Seems like it is only tar for now.
We can have it in core until all the distributions in core updated with jre options, before we can fetch this into releases.
Would you mind giving possible timeline on this change @reta?

Wondering if we have time to bring it into 2.9, or 2.10.
(Edit: seems we can only bring this into 3.x per opensearch-project/OpenSearch#8195 for now)
I do not think 1.x would have this change as 1.x is in maintenance mode now, and this is some what of a minor change.

Need more inputs: @dblock @bbarani

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New Enhancement v3.0.0
Projects
Development

No branches or pull requests

5 participants