Skip to content

Commit 4bdb2af

Browse files
author
thr3a
committed
update: cuda 12.4
1 parent 975abf2 commit 4bdb2af

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

cuda12.4-torch/Dockerfile

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,27 @@ ENV PIP_NO_CACHE_DIR=on
1010
ENV PYTHONDONTWRITEBYTECODE=1
1111
ENV UV_PROJECT_ENVIRONMENT="/usr/"
1212

13-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv f23c5a6cf475977595c89f51ba6932366a755776 \
14-
&& echo "deb http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main" > /etc/apt/sources.list.d/python.list \
15-
&& echo "deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main" >> /etc/apt/sources.list.d/python.list
13+
RUN apt-get update && apt-get install -y --no-install-recommends ${PACKAGES}
14+
15+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
16+
--mount=type=cache,target=/var/lib/apt,sharing=locked <<INSTALL_UBUNTU_PYTHON
17+
fingerprint=F23C5A6CF475977595C89F51BA6932366A755776
18+
repo=deadsnakes
19+
subrepo=ppa
20+
ubuntu_version=$(. /etc/os-release && echo $VERSION_CODENAME)
21+
curl -sS "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x${fingerprint}" > "./${repo}.asc"
22+
cat "./${repo}.asc" | gpg --dearmor -o "/etc/apt/keyrings/${repo}.gpg"
23+
echo "deb [signed-by=/etc/apt/keyrings/${repo}.gpg] http://ppa.launchpad.net/${repo}/${subrepo}/ubuntu ${ubuntu_version} main" | tee -a /etc/apt/sources.list.d/${repo}.list
24+
25+
apt-get update
26+
apt-get install --no-install-recommends -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev
27+
ln -nfs /usr/bin/python${PYTHON_VERSION} /usr/bin/python
28+
ln -nfs /usr/bin/python${PYTHON_VERSION} /usr/bin/python3
29+
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - --break-system-packages
30+
rm -rf /var/lib/apt/lists/*
31+
pip install uv
32+
INSTALL_UBUNTU_PYTHON
1633

17-
RUN apt-get update \
18-
&& apt-get install -y --no-install-recommends ${PACKAGES} python${PYTHON_VERSION} \
19-
&& ln -nfs /usr/bin/python${PYTHON_VERSION} /usr/bin/python \
20-
&& ln -nfs /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 \
21-
&& rm -rf /var/lib/apt/lists/* \
22-
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | python - \
23-
&& pip install uv
2434
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
2535

2636
WORKDIR /app

0 commit comments

Comments
 (0)