Skip to content

SOLR-15949: Docker, use Java 17#556

Merged
dsmiley merged 7 commits intoapache:mainfrom
dsmiley:solr-15949-docker-java17
Feb 14, 2022
Merged

SOLR-15949: Docker, use Java 17#556
dsmiley merged 7 commits intoapache:mainfrom
dsmiley:solr-15949-docker-java17

Conversation

@dsmiley
Copy link
Contributor

@dsmiley dsmiley commented Jan 22, 2022

azul/zulu-openjdk-alpine:17-jre-headless

Also switched OS from Debian to Alpine. WIP

https://issues.apache.org/jira/browseSOLR-15949

It wasn't easy to find a Java 17 JRE in Docker hub but I ultimately did with Azul. I trust them.

In my attempt to do this, I wound up choosing Alpine, which is another, perhaps bigger change. I'd be happy to move this off to another issue; I really should but I'm pushing this now to show what I have since I put time into it. I think most edits and possible further TODO in this PR are due to Alpine.

  • I added su-exec instead of gosu which I found easier to install, and I hear it's smaller. I removed to gosu test; honestly I'm not sure where it's used -- if nowhere then maybe we don't need a test.
  • init-var-solr was using cp -a ... but I saw warnings because the owner couldn't be preserved, which makes sense. This could be done independently of this PR; it may not be related but it was a warning I saw.
  • I tested gradlew testDocker and it passes.
  • I suspect the official image building might not work because I didn't find all of the unix add-ons when converting to apk. I didn't try it yet; this is a TODO.

azul/zulu-openjdk-alpine:17-jre-headless

Also switched OS from Debian to Alpine.  WIP
@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 22, 2022

I saw this JIRA issue about lsof https://issues.apache.org/jira/browse/SOLR-13089 that was closed because we moved away from Alpine once but may be relevant again.

@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 22, 2022

FYI https://hub.docker.com/r/azul/zulu-openjdk-alpine/tags
JRE vs JDK saves almost 80MB which is a ton. Interestingly the "-headless" seems to change nothing for the image sizes. Note that the numbers there are compressed numbers. When it gets to your machine, these expand significantly.

@HoustonPutman
Copy link
Contributor

As for the change from debian to alpine, I don't think we can use that image as our default base image: https://github.com/docker-library/official-images#repeatability

Official images can't be built on top of non-official images.

Copy link
Contributor

@janhoy janhoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose we use eclipse-temurin:17-jre which is an official jre image, slimmer than openjdk:17-slim.

dsmiley and others added 2 commits February 7, 2022 14:29
Co-authored-by: Jan Høydahl <janhoy@users.noreply.github.com>
Co-authored-by: Jan Høydahl <janhoy@users.noreply.github.com>
@janhoy
Copy link
Contributor

janhoy commented Feb 8, 2022

Tested SOLR_DOCKER_BASE_IMAGE=eclipse-temurin:17-jre ./gradlew dockerBuild and started the resulting image. Worked great. Just add CHANGES and possibly major-changes entries and we shuold be good.

Copy link
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too.

# Conflicts:
#	solr/CHANGES.txt
#	solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
@dsmiley dsmiley merged commit c869e0e into apache:main Feb 14, 2022
@dsmiley dsmiley deleted the solr-15949-docker-java17 branch February 14, 2022 06:06
dsmiley added a commit that referenced this pull request Feb 14, 2022
Specifically eclipse-temurin:17-jre

Co-authored-by: Jan Høydahl <janhoy@users.noreply.github.com>
dsmiley added a commit that referenced this pull request Feb 14, 2022
Specifically eclipse-temurin:17-jre

Co-authored-by: Jan Høydahl <janhoy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants