Skip to content

Commit 6c7ce35

Browse files
committed
python 3.10 slim.
1 parent 98bd0a9 commit 6c7ce35

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

docker/diffusers-pytorch-cpu/Dockerfile

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
1-
FROM ubuntu:20.04
1+
FROM python:3.10-slim
2+
ENV PYTHONDONTWRITEBYTECODE=1
23
LABEL maintainer="Hugging Face"
34
LABEL repository="diffusers"
45

56
ENV DEBIAN_FRONTEND=noninteractive
67

7-
RUN apt-get -y update \
8-
&& apt-get install -y software-properties-common \
9-
&& add-apt-repository ppa:deadsnakes/ppa \
10-
&& apt-get -y update
8+
RUN apt-get -y update && apt-get install -y bash \
9+
build-essential \
10+
git \
11+
git-lfs \
12+
curl \
13+
ca-certificates \
14+
libsndfile1-dev \
15+
libgl1
1116

12-
RUN apt-get install -y bash \
13-
build-essential \
14-
git \
15-
git-lfs \
16-
curl \
17-
ca-certificates \
18-
libsndfile1-dev \
19-
python3.10 \
20-
python3.10-dev \
21-
python3-pip \
22-
libgl1 \
23-
python3.10-venv && \
24-
rm -rf /var/lib/apt/lists/*
25-
26-
# make sure to use venv
27-
RUN python3.10 -m venv /opt/venv
28-
ENV PATH="/opt/venv/bin:$PATH"
17+
ENV UV_PYTHON=/usr/local/bin/python
2918

3019
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
31-
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
32-
python3.10 -m uv pip install --no-cache-dir \
20+
RUN pip install --no-cache-dir --upgrade uv \
21+
uv pip install --no-cache-dir \
3322
torch \
3423
torchvision \
3524
torchaudio \
3625
invisible_watermark \
3726
--extra-index-url https://download.pytorch.org/whl/cpu && \
38-
python3.10 -m uv pip install --no-cache-dir \
27+
uv pip install --no-cache-dir \
3928
accelerate \
4029
datasets \
4130
hf-doc-builder \

0 commit comments

Comments
 (0)