2023-08-07 alpine 制作jdk 镜像
2023-08-06 本文已影响0人
simok
FROM alpine:latest
MAINTAINER hzx
CMD ["/bin/sh"]
#更换aline源
#RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/community" > /etc/apk/repositories
#RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main" >> /etc/apk/repositories
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
#update apk
RUN apk update && apk upgrade
RUN apk --no-cache --upgrade add ca-certificates
# bash vim wget curl net-tools
RUN apk add --no-cache bash bash-doc bash-completion
RUN apk add --no-cache vim wget curl net-tools
RUN /bin/bash
ADD sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub
#setup glibc
RUN wget https://ghproxy.com/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk
RUN wget https://ghproxy.com/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-bin-2.32-r0.apk
RUN wget https://ghproxy.com/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-i18n-2.32-r0.apk
RUN wget https://ghproxy.com/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-dev-2.32-r0.apk
RUN apk -U upgrade
RUN apk add --force-overwrite glibc-2.32-r0.apk glibc-bin-2.32-r0.apk glibc-dev-2.32-r0.apk glibc-i18n-2.32-r0.apk
#setup date
RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#setup language 解决中文乱码
RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
ENV LANG=en_US.UTF-8
#copy jdk-8u161-linux-x64.tar.gz
ADD jdk-7u80-linux-x64.tar.gz /usr/local
#setup java env
ENV JAVA_HOME=/usr/local/jdk1.7.0_80
ENV PATH=$PATH:.:$JAVA_HOME/bin
ENV CALSSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar