Browse Source

awg timezone

anweiguo 1 week ago
parent
commit
5a22957042
1 changed files with 8 additions and 7 deletions
  1. 8 7
      Dockerfile

+ 8 - 7
Dockerfile

@@ -1,13 +1,14 @@
-
-FROM ubuntu:latest
-# 安装 tzdata 包并设置时区
-RUN apt-get update && apt-get install -y tzdata
-ENV TZ=Asia/Shanghai
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
 # 使用官方 Python 镜像作为基础镜像
 # 使用官方 Python 镜像作为基础镜像
 FROM 192.168.1.36:5000/python:3.12
 FROM 192.168.1.36:5000/python:3.12
 
 
+ENV TZ=Asia/Shanghai
+RUN apt-get update && \
+    apt-get install -y tzdata && \
+    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
+    echo $TZ > /etc/timezone && \
+    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure tzdata && \
+    apt-get clean
+
 ENV LANG=en_US.UTF-8
 ENV LANG=en_US.UTF-8
 # 设置工作目录
 # 设置工作目录
 WORKDIR /app
 WORKDIR /app