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

Support to OpenJDK 17? #70

Open
aldoborrero opened this issue Dec 3, 2021 · 4 comments
Open

Support to OpenJDK 17? #70

aldoborrero opened this issue Dec 3, 2021 · 4 comments

Comments

@aldoborrero
Copy link

Is it possible to add support to OpenJDK 17 LTS?

@mzellho
Copy link

mzellho commented Dec 20, 2021

@aldoborrero: Using Quarkus, I'd love to have a OpenJDK 17 version too. For experimental purposes, I cloned the repo and did an ubi 8.4 / OpenJDK 17 image myself, but presumably there is some more work to do:

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4

USER root

RUN mkdir -p /deployments

# JAVA_APP_DIR is used by run-java.sh for finding the binaries
ENV JAVA_APP_DIR=/deployments \
    JAVA_MAJOR_VERSION=17


# /dev/urandom is used as random source, which is prefectly safe
# according to http://www.2uo.de/myths-about-urandom/
RUN microdnf install java-17-openjdk-headless-17.0.1.0.12-2.el8_5.x86_64 \
      openssl curl ca-certificates \
    && echo "securerandom.source=file:/dev/urandom" >> /usr/lib/jvm/jre/lib/security/java.security \
    && microdnf clean all

ENV JAVA_HOME /etc/alternatives/jre

# Agent bond including Jolokia and jmx_exporter
ADD agent-bond-opts /opt/run-java-options
RUN mkdir -p /opt/agent-bond \
 && curl https://repo.maven.apache.org/maven2/io/fabric8/agent-bond-agent/1.2.0/agent-bond-agent-1.2.0.jar \
          -o /opt/agent-bond/agent-bond.jar \
 && chmod 444 /opt/agent-bond/agent-bond.jar \
 && chmod 755 /opt/run-java-options
ADD jmx_exporter_config.yml /opt/agent-bond/
EXPOSE 8778 9779

# Add run script as /deployments/run-java.sh and make it executable
COPY run-java.sh /deployments/
RUN chmod 755 /deployments/run-java.sh




# Run under user "1001" and prepare for be running
# under OpenShift, too
RUN chown 1001 /deployments \
    && chmod "g+rwX" /deployments \
    && chown 1001:root /deployments \
    && chmod g+rw /etc/passwd \
    && mkdir -p /deployments/data \
    && chown 1001 /deployments/run-java.sh

# Gives uid
USER 1001

CMD [ "/deployments/run-java.sh" ]

@aldoborrero
Copy link
Author

Hi @mzellho thanks for sharing! I forget to mention that I forked the repository and added preliminary support to Centos8 / JDK17. Unfortunately Centos8 will finish support on December (which is now).

Maybe we can integrate your work on ubi in that repository as well.

@mzellho
Copy link

mzellho commented Dec 20, 2021

@aldoborrero Oh, that is good news! I've got the feeling that it would be a good idea to go to ubi 8.5 as well (as the OpenJDK package seems like it's meant to be used in an 8.5 context, too). I have not made any tests here, just few very tiny steps, and unfortunately there is not too much time for more testing. But if you think that it would be a good add-on to your repository already, I'll happily contribute.

@aldoborrero
Copy link
Author

@mzellho feel free to take a look to the repository as I added support to UBI 8.5 and also to Alpine and Ubuntu 20.04.

Would you mind to test it? I'll do my part on Ubuntu as I need that particular image for what I'm currently working on. As this is still a much WIP I haven't uploaded any of the images to Docker Hub.

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

No branches or pull requests

2 participants