设置时区

master
pan 4 years ago
parent 16779c8428
commit 8ef5525c73
  1. 13
      Dockerfile

@ -1,10 +1,7 @@
#使用alpine作为基础镜像 #使用alpine作为基础镜像
FROM node:current-alpine3.12 FROM node:current-alpine3.12
# 设置时区为上海
RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
#拷贝公钥免密克隆仓库代码 #拷贝公钥免密克隆仓库代码
COPY .ssh /root/.ssh COPY .ssh /root/.ssh
#拷贝到容器里的密钥需要修改权限才能正常使用 #拷贝到容器里的密钥需要修改权限才能正常使用
@ -18,8 +15,12 @@ RUN ln -s /app/* /usr/local/bin/ && chmod +x /app/*
COPY admin@openresty.com-5ea678a6.rsa.pub /etc/apk/keys/admin@openresty.com-5ea678a6.rsa.pub COPY admin@openresty.com-5ea678a6.rsa.pub /etc/apk/keys/admin@openresty.com-5ea678a6.rsa.pub
RUN echo "http://openresty.org/package/alpine/v3.12/main" \ RUN echo "http://openresty.org/package/alpine/v3.12/main" \
| tee -a /etc/apk/repositories | tee -a /etc/apk/repositories
#使用阿里云镜像源安装git openssh curl openresty #使用阿里云镜像源安装库
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add git openssh curl openresty RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add git openssh curl openresty tzdata
# 设置时区为上海
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
WORKDIR /usr/local/openresty/nginx WORKDIR /usr/local/openresty/nginx
#备份openresty默认配置,拷贝自定义配置 #备份openresty默认配置,拷贝自定义配置
RUN mv conf/nginx.conf conf/nginx.conf.bak RUN mv conf/nginx.conf conf/nginx.conf.bak

Loading…
Cancel
Save