1.下载jdk-17

# wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz

2. 编写dockerfile

FROM centos:7

ENV JAVA_HOME=/usr/local/jdk-17.0.5
ENV JRE_HOME=$JAVA_HOME/jre
ENV PATH=${JAVA_HOME}/bin:$PATH

ADD jdk-17_linux-x64_bin.tar.gz /usr/local/ 
RUN javac --version  && java --version 

3.build

#!/bin/bash

docker build -t uhub.service.ucloud.cn/wgs-test/jdk:17.0.5 .

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐