alpine镜像修改为本地时区

2019-11-19 21:56:08 浏览数 (1)

示例如下:

代码语言:javascript复制
FROM node:10-alpine

# 时区
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache tzdata 
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
    && echo "Asia/Shanghai" > /etc/timezone 
    &&rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache ## 清除缓存

COPY . /app

WORKDIR /app
RUN npm install --registry=https://registry.npm.taobao.org

EXPOSE 6000

CMD ["npm","run","start"]

(adsbygoogle = window.adsbygoogle || []).push({});

0 人点赞