-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_l4t
More file actions
96 lines (83 loc) · 4.16 KB
/
Dockerfile_l4t
File metadata and controls
96 lines (83 loc) · 4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Dockerfile
FROM dustynv/pytorch:2.7-r36.4.0-cu128-24.04
ARG PROXY
ARG USE_OLD_TRANSFORMERS=0
ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
TRANSFORMERS_CACHE=/workspace/.hf \
HF_HOME=/workspace/.hf \
HF_ENDPOINT=https://hf-mirror.com \
TZ=Asia/Shanghai
RUN chmod 1777 /tmp && apt-get update && apt-get install -y \
curl wget ca-certificates \
tar \
&& update-ca-certificates && rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y tzdata && \
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
RUN apt-get update && apt-get install -y git ffmpeg libglib2.0-0 libsm6 libxrender1 libxext6
# RUN apt-get update && apt-get install -y python3 python3-pip git ffmpeg libglib2.0-0 libsm6 libxrender1 libxext6 libopenblas0-pthread libopenblas-dev
RUN pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple
RUN pip3 config set install.trusted-host mirrors.aliyun.com
# RUN pip3 install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cu124 \
# RUN pip3 install -U --no-cache-dir transformers FlagEmbedding uvicorn fastapi
# RUN set -e; \
# if [ -n "${PROXY:-}" ]; then \
# echo "using proxy ${PROXY}"; \
# # 在同一子shell里 export,一次性作用于两个 wget
# ( export http_proxy="${PROXY}" https_proxy="${PROXY}" HTTP_PROXY="${PROXY}" HTTPS_PROXY="${PROXY}"; \
# wget -O torch-2.8.0-cp310-cp310-linux_aarch64.whl \
# https://pypi.jetson-ai-lab.io/jp6/cu126/+f/62a/1beee9f2f1470/torch-2.8.0-cp310-cp310-linux_aarch64.whl && \
# wget -O torchvision-0.23.0-cp310-cp310-linux_aarch64.whl \
# https://pypi.jetson-ai-lab.io/jp6/cu126/+f/907/c4c1933789645/torchvision-0.23.0-cp310-cp310-linux_aarch64.whl \
# ); \
# else \
# wget -O torch-2.8.0-cp310-cp310-linux_aarch64.whl \
# https://pypi.jetson-ai-lab.io/jp6/cu126/+f/62a/1beee9f2f1470/torch-2.8.0-cp310-cp310-linux_aarch64.whl && \
# wget -O torchvision-0.23.0-cp310-cp310-linux_aarch64.whl \
# https://pypi.jetson-ai-lab.io/jp6/cu126/+f/907/c4c1933789645/torchvision-0.23.0-cp310-cp310-linux_aarch64.whl; \
# fi && \
# pip install --no-cache-dir ./torch-2.8.0-cp310-cp310-linux_aarch64.whl ./torchvision-0.23.0-cp310-cp310-linux_aarch64.whl && \
# rm -f torch-2.8.0-cp310-cp310-linux_aarch64.whl torchvision-0.23.0-cp310-cp310-linux_aarch64.whl
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple && \
pip config set install.trusted-host mirrors.aliyun.com && \
if [ "$USE_OLD_TRANSFORMERS" = "1" ]; then \
pip install --no-cache-dir open-clip-torch timm "transformers>=4.40,<4.45" FlagEmbedding uvicorn fastapi numpy==1.26.4 \
--index-url https://mirrors.aliyun.com/pypi/simple \
--trusted-host mirrors.aliyun.com/pypi/simple \
--timeout 120 --retries 5 \
--upgrade-strategy only-if-needed \
--break-system-packages; \
else \
pip install --no-cache-dir open-clip-torch timm transformers FlagEmbedding uvicorn fastapi numpy==1.26.4 \
--index-url https://mirrors.aliyun.com/pypi/simple \
--trusted-host mirrors.aliyun.com/pypi/simple \
--timeout 120 --retries 5 \
--upgrade-strategy only-if-needed \
--break-system-packages; \
fi
RUN set -e; \
if [ -n "${PROXY}" ]; then \
echo "Using PROXY=${PROXY} for pip"; \
export HTTP_PROXY="${PROXY}" HTTPS_PROXY="${PROXY}" http_proxy="${PROXY}" https_proxy="${PROXY}"; \
export NO_PROXY="localhost,127.0.0.1" no_proxy="localhost,127.0.0.1"; \
fi; \
pip3 install --no-cache-dir --break-system-packages \
numpy==1.26.4 \
onnxruntime-gpu \
--index-url https://pypi.jetson-ai-lab.io/jp6/cu129/+simple \
--trusted-host pypi.jetson-ai-lab.io \
--timeout 120 --retries 5 \
--upgrade-strategy only-if-needed
WORKDIR /app
COPY manager/ /app/manager/
COPY worker/ /app/worker/
COPY start.sh /app/
# 默认启动 Manager
ENV HOST=0.0.0.0 PORT=18000
EXPOSE 18000
CMD ["/app/start.sh"]