Last active
December 16, 2022 08:58
-
-
Save thesadabc/6f730b2a9d6899d5694287b548114189 to your computer and use it in GitHub Desktop.
基础镜像构建模板,alpine与debian系统,包含时区及软件安装
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
ENV TZ=Asia/Shanghai | |
RUN \ | |
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ | |
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \ | |
&& apk update \ | |
&& apk add --no-cache dumb-init build-base \ | |
&& rm -rf /var/cache/apk/* /usr/share/man /tmp/* | |
ENTRYPOINT ["/usr/bin/dumb-init"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:bullseye | |
ENV TZ=Asia/Shanghai | |
RUN \ | |
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ | |
&& sed -i 's/\(deb\|security\|snapshot\).debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \ | |
&& apt-get update \ | |
&& apt-get install -y --no-install-recommends dumb-init \ | |
&& rm -rf /var/cache/apk/* /var/lib/apt/lists/* /usr/share/man /tmp/* | |
ENTRYPOINT ["/usr/bin/dumb-init"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment