基于alpine创建oracle jdk容器镜像

Java是基于GUN Standard C library(glibc)
Alpine是基于MUSL libc(mini libc)

FROM alpine:latest
MAINTAINER guangjie <guangjie@gjie.cn>
WORKDIR /tmp
ADD server-jre-8u221-linux-x64.tar.gz /usr/local/
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo ‘Asia/Shanghai’ >/etc/timezone
RUN apk –no-cache add ca-certificates wget && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk && \
apk add glibc-2.29-r0.apk
ENV JAVA_HOME /usr/local/jdk1.8.0_221
ENV CLASSPATH .:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
ENV PATH $PATH:$JAVA_HOME/bin:$JRE_HOME/bin

点赞