添加docker容器的时区设置,以保证容器内时间与本地时间同步

This commit is contained in:
2024-07-22 09:01:07 +08:00
parent e52f213540
commit 9bcbfdb5ec

View File

@@ -1,4 +1,3 @@
ARG VERSION
# 使用官方的paddle镜像作为基础
FROM registry.baidubce.com/paddlepaddle/paddle:2.6.1-gpu-cuda12.0-cudnn8.9-trt8.6
@@ -6,8 +5,9 @@ FROM registry.baidubce.com/paddlepaddle/paddle:2.6.1-gpu-cuda12.0-cudnn8.9-trt8.
WORKDIR /app
# 设置环境变量
ENV VERSION=${VERSION} \
PYTHONUNBUFFERED=1 \
ENV PYTHONUNBUFFERED=1 \
# 设置时区
TZ=Asia/Shanghai \
# 设置pip镜像地址加快安装速度
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
@@ -15,7 +15,8 @@ ENV VERSION=${VERSION} \
COPY . /app
# 安装任何需要的包
RUN pip install --no-cache-dir -r requirements.txt \
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone \
&& pip install --no-cache-dir -r requirements.txt \
&& pip uninstall -y onnxruntime onnxruntime-gpu \
&& pip install onnxruntime-gpu==1.18.0 --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/