安装glibc
:https://github.com/sgerrand/alpine-pkg-glibc/
设置时区
RUN echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/main\n\
https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/community" > /etc/apk/repositories
Install base packages
RUN apk update && apk --no-cache add tzdata ca-certificates wget \
&& cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
制作基础镜像
Dockerfile
FROM alpine:latest
RUN echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/main\n\
https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/community" > /etc/apk/repositories
Install base packages
RUN apk update && apk --no-cache add tzdata ca-certificates wget \
&& cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk && apk add glibc-2.27-r0.apk && rm -f glibc-2.27-r0.apk /etc/apk/keys/sgerrand.rsa.pub
docker build -t hub.linuxeye.com/library/alpine:latest . #生成镜像
docker push hub.linuxeye.com/library/alpine:latest #推送私有仓库
有疑问加站长微信联系(非本文作者)