-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdockerfile
More file actions
42 lines (34 loc) · 1.3 KB
/
dockerfile
File metadata and controls
42 lines (34 loc) · 1.3 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
FROM nvcr.io/nvidia/pytorch:25.04-py3
# Set up environment variables
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Install system dependencies and ffmpeg in one layer
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
xz-utils \
&& rm -rf /var/lib/apt/lists/* \
&& cd /tmp \
&& curl -L https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
&& tar -xf ffmpeg.tar.xz \
&& cd ffmpeg-*-static \
&& install -m 0755 ffmpeg /usr/local/bin/ffmpeg \
&& install -m 0755 ffprobe /usr/local/bin/ffprobe \
&& cd / \
&& rm -rf /tmp/ffmpeg* \
&& ffprobe -version
# Copy requirements file first (for better caching)
COPY requirements.txt /tmp/requirements.txt
# Install Python packages in optimized order
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com nvidia-dali-cuda110 && \
pip install --no-cache-dir -r /tmp/requirements.txt && \
rm /tmp/requirements.txt
# Set default command
CMD ["/bin/bash"]