openjdk-docker icon indicating copy to clipboard operation
openjdk-docker copied to clipboard

Add Support for Multiple Docker Base Images on Official DockerHub

Open james-crowley opened this issue 5 years ago • 6 comments

With testing for other base images right around the corner, https://github.com/AdoptOpenJDK/openjdk-tests/issues/1109, I wanted to make sure all correct base images made it into the testing pipeline. Thus allowing the new base images to get tested and pushed up to the official DockerHub repository, https://hub.docker.com/_/adoptopenjdk.

Currently the only base images in the official DockerHub repository are:

  • Ubuntu (Bionic)
  • Windows Server Core

The unofficial DockerHub repositories currently support:

  • Ubuntu (Bionic)
  • Alpine (3.10)
  • Debian (Stretch)
  • Windows Server Core (1803, 1809, LTSC 2016)
  • Ubi-Minimal

It would be nice to start moving some of the base images in the unofficial DockerHub repositories to the official repository after testing has been completed.

In addition it would be nice to add support for the following additional base images:

  • CentOS/ClefOS - #12 - https://hub.docker.com/_/clefos
  • Windows Nano Server - https://hub.docker.com/_/microsoft-windows-nanoserver

Some other improvements that should be made while adding more base images/tags are:

  • Update Debian base image from stretch to buster - #200
  • Support Slim Builds in the official DockerHub repository
  • Investigate buildpack-deps for base image pulls, especially the curl tags, https://hub.docker.com/_/buildpack-deps/

@dinogun @smlambert

james-crowley avatar Oct 15 '19 20:10 james-crowley

@dinogun - do you have a clear view of what's left on this request? I'm wondering if we should split it out.

karianna avatar Nov 28 '19 18:11 karianna

@karianna Was interested in the status of this as well. I see some great progress on adding support for more base images but I am trying to figure out what is left to accomplish this. I'll try to sync up with @dinogun internally.

james-crowley avatar Dec 03 '19 19:12 james-crowley

@nealef Were planning on using ClefOS as one of the base images. Anything you think we should watch out for? Any gotchas when it comes to packages needed to get Adopt working?

james-crowley avatar Dec 05 '19 16:12 james-crowley

No. I've built images for 8 and 11 without any problems.

-------- Original message -------- From: Jim Crowley [email protected] Date: 12/6/19 03:40 (GMT+10:00) To: AdoptOpenJDK/openjdk-docker [email protected] Cc: Neale Ferguson [email protected], Mention [email protected] Subject: Re: [AdoptOpenJDK/openjdk-docker] Add Support for Multiple Docker Base Images on Official DockerHub (#236)

@nealefhttps://github.com/nealef Were planning on using ClefOS as one of the base images. Anything you think we should watch out for? Any gotchas when it comes to packages needed to get Adopt working?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/AdoptOpenJDK/openjdk-docker/issues/236?email_source=notifications&email_token=AACLN6WGYCRVTF5MBTV7X6TQXEVIHA5CNFSM4JBCZY2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGBKOMA#issuecomment-562210608, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACLN6QOER3PHCMV452KKTDQXEVIHANCNFSM4JBCZY2A.

nealef avatar Dec 05 '19 21:12 nealef

There was one issue that was still open for AdoptJDK on Z:

https://github.com/AdoptOpenJDK/openjdk-build/issues/1310

Also, here is the Docker file I was using for Z:

FROM            docker.io/clefos/clefos:latest

MAINTAINER      "The ClefOS Project" <[email protected]>

LABEL           Vendor="ClefOS" License="ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and MPLv1.1 and Public Domain and W3C"
LABEL           Version=11

RUN             yum update --setopt=tsflags=nodocs -y && \
                yum install --setopt=tsflags=nodocs -y tar

RUN             curl -s -L 'https://api.adoptopenjdk.net/v2/binary/releases/openjdk11?openjdk_impl=openj9&os=linux&arch=s390x&release=latest&type=jdk' -o /tmp/openjdk.tar.gz && \
                mkdir -p /usr/lib/jvm/java-11-openjdk && \
                tar -C /usr/lib/jvm/java-11-openjdk -xzf /tmp/openjdk.tar.gz --strip-components=1 && \
                ln -sf /usr/lib/jvm/java-11-openjdk /usr/lib/jvm/java && \
                rm -f /tmp/openjdk.tar.gz && \
                yum clean all && \
                rm -rf /var/cache/yum/* /tmp/* /var/log/yum.log

ENV             JAVA_HOME=/usr/lib/jvm/java
ENV             PATH=$PATH:$JAVA_HOME/bin

nealef avatar Dec 07 '19 17:12 nealef

Here is the ClefOS Dockerfile that was generated via my testing. Note I was only testing hotspot at the time:

FROM clefos:7

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

RUN yum install -y openssl curl ca-certificates fontconfig gzip locales tar \
    && yum update; yum clean all

ENV JAVA_VERSION jdk8u232-b09

RUN set -eux; \
    ARCH="$(uname -m)"; \
    case "${ARCH}" in \
       aarch64|arm64) \
         ESUM='35799a2fd4b467115aff1bc3a54853b5131ba9068e53e1ab0fbe5521a3f2ba83'; \
         BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u232b09.tar.gz'; \
         ;; \
       armhf) \
         ESUM='fdd9f61f1b2df74242da54ee3b3231b0123782a917e9673351276da439c7cab1'; \
         BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_arm_linux_hotspot_8u232b09.tar.gz'; \
         ;; \
       ppc64el|ppc64le) \
         ESUM='da87bdc04b47477b42afc76066dbd96efa35ad967238be03a0081f8840e893a8'; \
         BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_ppc64le_linux_hotspot_8u232b09.tar.gz'; \
         ;; \
       s390x) \
         ESUM='bd20cb8bf4cfab9d3e2b2ccfb9a6f9eda1e4e67b4103b9975d29de12c05ad1f5'; \
         BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_s390x_linux_hotspot_8u232b09.tar.gz'; \
         ;; \
       amd64|x86_64) \
         ESUM='7b7884f2eb2ba2d47f4c0bf3bb1a2a95b73a3a7734bd47ebf9798483a7bcc423'; \
         BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u232b09.tar.gz'; \
         ;; \
       *) \
         echo "Unsupported arch: ${ARCH}"; \
         exit 1; \
         ;; \
    esac; \
    curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
    echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
    mkdir -p /opt/java/openjdk; \
    cd /opt/java/openjdk; \
    tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
    rm -rf /tmp/openjdk.tar.gz;

ENV JAVA_HOME=/opt/java/openjdk \
    PATH="/opt/java/openjdk/bin:$PATH"

@nealef pretty similar to yours. I'll try to follow up with the error you were running into and see if we can get someone to look into more.

james-crowley avatar Dec 09 '19 13:12 james-crowley