设置apk的国内镜像源
echo "https://mirrors.aliyun.com/alpine/v$(cat /etc/alpine-release | cut -d. -f1,2)/main" > /etc/apk/repositories
echo "https://mirrors.aliyun.com/alpine/v$(cat /etc/alpine-release | cut -d. -f1,2)/community" >> /etc/apk/repositories
安装
apk add --no-cache tzdata
设置时区
export TZ=Asia/Shanghaidate
镜像制作
FROM alpine
USER rootRUN set -eux; \echo "https://mirrors.aliyun.com/alpine/v$(cat /etc/alpine-release | cut -d. -f1,2)/main" > /etc/apk/repositories; \echo "https://mirrors.aliyun.com/alpine/v$(cat /etc/alpine-release | cut -d. -f1,2)/community" >> /etc/apk/repositories; \apk update; \apk add --no-cache tzdata; \ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \echo "Asia/Shanghai" > /etc/timezone