diff --git a/bisheng-jdk/17.0.10/22.03-lts-sp3/Dockerfile b/bisheng-jdk/17.0.10/22.03-lts-sp3/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c42c4ab48779b3bd00db4d033a7a2d21eed6f215 --- /dev/null +++ b/bisheng-jdk/17.0.10/22.03-lts-sp3/Dockerfile @@ -0,0 +1,37 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp3 +FROM ${BASE} + +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=17.0.10 + +RUN yum update -y; \ + yum install -y ca-certificates p11-kit; \ + yum clean all + +ENV JAVA_HOME /usr/lib/jvm/java-openjdk-${VERSION} +ENV PATH $JAVA_HOME/bin:$PATH +ENV LANG C.UTF-8 +ENV JAVA_VERSION 17.0.10+11 + +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi; \ + curl -fSL -o bisheng-jdk.tar.gz https://mirrors.huaweicloud.com/kunpeng/archive/compiler/bisheng_jdk/bisheng-jdk-${VERSION}-linux-${BUILDARCH}.tar.gz; \ + mkdir -p ${JAVA_HOME}; \ + tar -xvf bisheng-jdk.tar.gz -C ${JAVA_HOME} --strip-components=1; \ + rm -f bisheng-jdk.tar.gz + +RUN update-ca-trust; \ + alternatives --install /usr/bin/java java "$JAVA_HOME/bin/java" 20000; \ + alternatives --install /usr/bin/javac javac "$JAVA_HOME/bin/javac" 20000; \ + alternatives --install /usr/bin/jshell jshell "$JAVA_HOME/bin/jshell" 20000; \ + java -Xshare:dump; \ + # basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +CMD ["jshell"] diff --git a/bisheng-jdk/README.md b/bisheng-jdk/README.md new file mode 100644 index 0000000000000000000000000000000000000000..249c11e90c34b3e119a21983e605238518da1e8f --- /dev/null +++ b/bisheng-jdk/README.md @@ -0,0 +1,30 @@ +# BiSheng JDK + +# Quick reference + +- The official BiSheng JDK docker image. + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative) + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community) + +# Build reference + +1. Build images and push: +```shell +docker buildx build -t "openeuler/bisheng-jdk:$TAG" --platform linux/amd64,linux/arm64 . --push +``` + +We are using `buildx` in here to generate multi-arch images, see more in [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) + +2. Run: +```shell +docker run -it --name openjdk openeuler/bisheng-jdk:{TAG} +``` + +# Supported tags and respective Dockerfile links + +- 17.0.10-oe2203sp3: BiSheng JDK 17.0.10, openEuler 22.03 LTS SP3 + +## Operating System +Linux/Unix, ARM64 or x86-64 architecture. diff --git a/bisheng-jdk/doc/image-info.yml b/bisheng-jdk/doc/image-info.yml new file mode 100644 index 0000000000000000000000000000000000000000..bd340be24e2291614d725a994192931f78d2875e --- /dev/null +++ b/bisheng-jdk/doc/image-info.yml @@ -0,0 +1,69 @@ +name: BiSheng JDK +category: others +description: BiSheng JDK(BiSheng Java Development Kit),即毕昇JDK,是华为内部基于OpenJDK定制的Huawei JDK的开源版本,作为OpenJDK的下游,是一款高性能、可用于生产环境的OpenJDK发行版。 +environment: | + 本应用在Docker环境中运行,安装Docker执行如下命令 + ``` + yum install -y docker + ``` +tags: | + BiSheng JDK镜像的Tag由其版本信息和基础镜像版本信息组成,详细内容如下 + + | Tag | Currently | Architectures | + |----------|-------------|------------------| + |[17.0.10-oe2203sp3](https://gitee.com/openeuler/openeuler-docker-images/blob/master/bisheng-jdk/17.0.10/22.03-lts-sp3/Dockerfile)| BiSheng JDK 17.0.10 on openEuler 22.03-LTS-SP3 | amd64, arm64 | + + 注意,以下`{Tag}`的值按照需求,替换为上述表格中的tag内容。 + +download: | + 拉取镜像到本地 + ``` + docker pull openeuler/bisheng-jdk:{Tag} + ``` + +usage: | + `openeuler/bisheng-jdk`镜像提供基于OpenJDK定制的Java开发及运行环境,使用方式如下 + - 运行JAVA应用 + 使用`openeuler/bisheng-jdk`容器作为构建和运行时环境,可按照以下内容编译并运行项目 + ``` + # Dockerfile + FROM openeuler/bisheng-jdk:{Tag} + + COPY . /usr/src/myapp + WORKDIR /usr/src/myapp + RUN javac Main.java + CMD ["java", "Main"] + ``` + + 构建并运行应用 + ``` + docker build -t my-java-app . + docker run -it --rm --name my-running-app my-java-app + ``` + + - 编译JAVA源码 + + 只编译源码不运行,可采用如下方式 + ``` + docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openeuler/bisheng-jdk:{Tag} javac Main.java + ``` + 这会将当前目录作为卷添加到容器中,将工作目录设置为该卷,然后运行执行`javac Main.java`编译`Main.java`中的代码。 + + - 容器测试 + + 使用以下方式验证镜像内安装的JAVA环境: + ``` + docker run -it openeuler/bisheng-jdk:{Tag} java --version + ``` + 例如,`{Tag}`为`17.0.10-oe2203sp3`时,返回类似如下信息则证明环境正常: + ``` + openjdk 17.0.10 2024-01-16 + OpenJDK Runtime Environment BiSheng (build 17.0.10+11) + OpenJDK 64-Bit Server VM BiSheng (build 17.0.10+11, mixed mode, sharing) + ``` + +license: GPL-2.0 license +similar_packages: + - N/A +dependency: + - N/A \ No newline at end of file diff --git a/bisheng-jdk/doc/picture/logo.png b/bisheng-jdk/doc/picture/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c2a6de538582c81e1e8110798f4b94adb6ce4ce3 Binary files /dev/null and b/bisheng-jdk/doc/picture/logo.png differ diff --git a/bisheng-jdk/meta.yml b/bisheng-jdk/meta.yml new file mode 100644 index 0000000000000000000000000000000000000000..e45b38ccf1079402a7ae0de5ca682070c1b584b9 --- /dev/null +++ b/bisheng-jdk/meta.yml @@ -0,0 +1,2 @@ +17.0.10-oe2203sp3: + bisheng-jdk/17.0.10/22.03-lts-sp3/Dockerfile \ No newline at end of file