From 63d2a1d728468c040520b4a654c86416f546c674 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Fri, 6 Jul 2018 15:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E7=82=B9=E6=9B=B4=E6=96=B0=EF=BC=9A20?= =?UTF-8?q?18-07-06=2015:11:14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alpine-mysql/Dockerfile | 10 +++++++--- blog/Dockerfile | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/alpine-mysql/Dockerfile b/alpine-mysql/Dockerfile index 0da054c..3840501 100644 --- a/alpine-mysql/Dockerfile +++ b/alpine-mysql/Dockerfile @@ -1,14 +1,18 @@ FROM alpine:latest LABEL maintainer="ehlxr.me@gmail.com" +ENV TZ "Asia/Shanghai" + WORKDIR /app VOLUME /data -RUN apk add --update --no-cache mysql mysql-client \ - && rm -f /var/cache/apk/* +RUN apk add --update --no-cache mysql mysql-client tzdata \ + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ + && echo ${TZ} > /etc/timezone \ + && rm -rf /var/cache/apk/* COPY my.cnf /etc/mysql/my.cnf COPY startup.sh /startup.sh EXPOSE 3306 -CMD ["/startup.sh"] +CMD ["/startup.sh"] \ No newline at end of file diff --git a/blog/Dockerfile b/blog/Dockerfile index 8c094b2..ad5ea90 100644 --- a/blog/Dockerfile +++ b/blog/Dockerfile @@ -9,6 +9,12 @@ RUN hexo generate && gulp FROM nginx:alpine LABEL maintainer="ehlxr.me@gmail.com" +ENV TZ "Asia/Shanghai" WORKDIR /usr/share/nginx/html COPY --from=0 /hexo/public . +RUN apk upgrade --update \ + && apk add tzdata \ + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ + && echo ${TZ} > /etc/timezone \ + && rm -rf /var/cache/apk/* ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file