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

Add Dockerfile for JDK 20 on Red Hat UBI 9 #176

Merged
merged 1 commit into from May 5, 2023
Merged

Add Dockerfile for JDK 20 on Red Hat UBI 9 #176

merged 1 commit into from May 5, 2023

Conversation

cam-rod
Copy link
Contributor

@cam-rod cam-rod commented May 3, 2023

  • Splitting the current Dockerfile into two: <= JDK 19 (on CentOS 7) and >= JDK 20 (on Red Hat UBI 9)
    • Dockerfiles don't really support swappable base images (buildah would work better for that), so the solution here is a multi-stage build, with the first stage validating that the JDK matches the file bounds. The stage isn't necessary, but makes for a decent sanity check.
  • Updated the CI action by splitting it into CentOS and UBI jobs. Same as above, there isn't an easy way to filter a matrix of JDK versions without switching off Dockerfiles entirely.

Closes #175.

@jmesnil
Copy link
Contributor

jmesnil commented May 4, 2023

you could make the suffix of the base image (centos7 & ubi9) a dist ARG to continue to use a single Dockerfile with the base image being eclipse-temurin:${jdk}-{dist}

Then in the github action, you only need to associate the jdk versions with the dist (eg using env var):

  • 11, 17, 19 -> centos7
  • 20 -> ubi9

@jmesnil
Copy link
Contributor

jmesnil commented May 4, 2023

You should have a look at https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude to replace:

strategy:
  matrix:
    jdk-version: [11, 17]

with:

strategy:
  matrix:
    include:
      - jdk-version: 11
        dist: centos7
      - jdk-version: 17
        dist: centos7
      - jdk-version: 20
        dist: ubi9

(I've not tested it)

@cam-rod
Copy link
Contributor Author

cam-rod commented May 4, 2023

made the suggested changes, let me know what you think

.github/workflows/publish-release.yml Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jmesnil jmesnil merged commit 8f990be into jboss-dockerfiles:master May 5, 2023
@jmesnil
Copy link
Contributor

jmesnil commented May 5, 2023

@cam-rod thanks

@cam-rod cam-rod deleted the jdk-20 branch May 5, 2023 14:27
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.

Add SE 20 images now that it is out
2 participants