Sign inSign up

cnrock/openjdk

By cnrock

•Updated 5 months ago

openjdk 17 base on Kylin v10 sp3

Image
Developer tools
0

2.3K

cnrock/openjdk repository overview

⁠Kylin Linux V10 SP3 + OpenJDK 17

This project provides a Docker image based on Kylin Linux V10 SP3 with OpenJDK 17 pre-installed, supporting amd64 (x86_64) and arm64 (aarch64) dual architectures.

Image on Docker Hub: cnrock/openjdk:17.0.19_10⁠

⁠Features

  • Based on official Kylin Linux V10 SP3 image: macrosan/kylin:v10-sp3-2403
  • Installs Eclipse Temurin OpenJDK 17.0.19+10
  • Automatically detects architecture and downloads the appropriate JDK package
  • Sets timezone to Asia/Shanghai and encoding to UTF-8
  • Default CMD: jshell -v (can be changed to java -version if needed)

⁠Files

  • Dockerfile: Build script for the image

⁠Dockerfile( english version)

# --------- 1. Select base image ---------
# Base image must support target architectures (x86_64 and aarch64)
FROM macrosan/kylin:v10-sp3-2403
LABEL maintainer="Wan Jie <[email protected]>"

# --------- 2. Install OpenJDK 17 (multi-architecture support) ---------
RUN set -eux; \
    ARCH=$(uname -m); \
    case "$ARCH" in \
        x86_64) \
            JDK_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.19%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.19_10.tar.gz" \
            ;; \
        aarch64) \
            JDK_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.19%2B10/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.19_10.tar.gz" \
            ;; \
        *) \
            echo "Unsupported architecture: $ARCH"; exit 1 \
            ;; \
    esac; \
    curl -L -o /tmp/jdk.tgz "$JDK_URL"; \
    mkdir -p /usr/local/jdk17; \
    tar -xzf /tmp/jdk.tgz -C /usr/local/jdk17 --strip-components=1; \
    rm -f /tmp/jdk.tgz; \
    ln -sf /usr/local/jdk17/bin/java /usr/bin/java; \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# Optional: Set environment variables
ENV JAVA_HOME=/usr/local/jdk17 \
    PATH=/usr/local/jdk17/bin:$PATH \
    LANG=C.UTF-8 \
    JAVA_TOOL_OPTIONS="-Duser.timezone=Asia/Shanghai"

# --------- 3. Verification / Runtime example ---------
# Note: A Dockerfile can only have one CMD. Keeping only java -version as reference.
#CMD ["java", "-version"]
CMD ["jshell -v"]

⁠How to Use Instructions


docker pull cnrock/openjdk:17.0.19_10
docker run -it --rm cnrock/openjdk:17.0.19_10 jshell -v
docker run -it  cnrock/openjdk:17.0.19_10 bash

Tag summary

Content type

Image

Digest

sha256:17fc6a2d6…

Size

290.4 MB

Last updated

5 months ago

docker pull cnrock/openjdk