JDK dockerfile

发布时间 2023-03-22 21:09:34作者: 小维江湖

包含了时区,中文字体,tini

FROM openjdk:8u342-jre-slim-bullseye

ENV TZ=Asia/Shanghai \
    DEBIAN_FRONTEND=noninteractive \
    TINI_VERSION=v0.19.0

ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-arm64 /bin/tini

RUN sed -i "s@http://ftp.debian.org@https://repo.huaweicloud.com@g" /etc/apt/sources.list \
    && sed -i "s@http://security.debian.org@https://repo.huaweicloud.com@g" /etc/apt/sources.list \
    && apt-get update \
    && apt-get install -y tzdata fontconfig libfreetype6 \
    && ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
    && echo ${TZ} > /etc/timezone \
    && dpkg-reconfigure --frontend noninteractive tzdata \
    && rm -rf /var/lib/apt/lists/* \
	&& chmod +x /bin/tini

ENTRYPOINT ["/bin/tini", "--"]