Use Asia/Shanghai as the timezone in docker

This commit is contained in:
Genteure 2021-06-23 17:59:59 +08:00
parent afdf66e917
commit 9fa19da9f5
2 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,8 @@ COPY . /src
RUN cd /src/BililiveRecorder.Cli && dotnet build -o /output -c Release
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine
RUN apk add --no-cache tzdata
ENV TZ=Asia/Shanghai
COPY --from=0 /output /app
VOLUME [ "/rec" ]
WORKDIR /app

View File

@ -1,4 +1,6 @@
FROM mcr.microsoft.com/dotnet/runtime:5.0
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY ./BililiveRecorder.Cli/bin/docker_out /app
VOLUME [ "/rec" ]
WORKDIR /app