基于alpine完成oracle jdk8

2022/6/5 2:20:26

本文主要是介绍基于alpine完成oracle jdk8,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.dockerfile

FROM    alpine:3.10

### 下载地址 https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
COPY    sgerrand.rsa.pub /etc/apk/keys

### 下载地址 https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk
COPY    glibc-2.29-r0.apk .

ADD     jdk-8u321-linux-x64.tar.gz /usr/local

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk update && apk upgrade \
    && apk --no-cache add tzdata \
    && cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime  \
    && echo "Asia/Shanghai" > /etc/timezone \
    && apk --no-cache add ca-certificates wget \
    && apk add glibc-2.29-r0.apk \
    && apk del tzdata \
    && rm -rf /var/cache/apk/* glibc-2.29-r0.apk


ENV     JAVA_HOME       /usr/local/jdk1.8.0_321
ENV     JRE_HOME        /usr/local/jdk1.8.0.321/jre
ENV     CLASSPATH       .:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
ENV     PATH            $PATH:$JAVA_HOME/bin:$JRE_HOME/bin

2.Alpine镜像中Gnu Libc的设定方法

步骤1: 下载key
wget https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub

步骤2: 下载apk安装文件
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk

步骤2: 安装
apk add glibc-2.29-r0.apk

源链接: https://blog.csdn.net/liumiaocn/article/details/89703177


这篇关于基于alpine完成oracle jdk8的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程