Skip to content

Commit 975abf2

Browse files
author
thr3a
committed
fix: cuda 12.6
1 parent a4e5122 commit 975abf2

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

cuda12.6-torch/Dockerfile

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM --platform=linux/x86_64 nvcr.io/nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
22

33
ARG PYTHON_VERSION=3.13
4-
ARG PACKAGES="git curl ca-certificates vim wget unzip build-essential cmake jq"
4+
ARG PACKAGES="git curl ca-certificates vim wget unzip build-essential cmake jq gnupg"
55

66
ENV DEBIAN_FRONTEND=noninteractive
77
ENV TZ=Asia/Tokyo
@@ -10,17 +10,28 @@ 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
14+
RUN apt-get install -y --no-install-recommends ${PACKAGES}
15+
16+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
17+
--mount=type=cache,target=/var/lib/apt,sharing=locked <<INSTALL_UBUNTU_PYTHON
18+
fingerprint=F23C5A6CF475977595C89F51BA6932366A755776
19+
repo=deadsnakes
20+
subrepo=ppa
21+
ubuntu_version=$(. /etc/os-release && echo $VERSION_CODENAME)
22+
curl -sS "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x${fingerprint}" > "./${repo}.asc"
23+
cat "./${repo}.asc" | gpg --dearmor -o "/etc/apt/keyrings/${repo}.gpg"
24+
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
25+
26+
apt-get update
27+
apt-get install --no-install-recommends -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev
28+
ln -nfs /usr/bin/python${PYTHON_VERSION} /usr/bin/python
29+
ln -nfs /usr/bin/python${PYTHON_VERSION} /usr/bin/python3
30+
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - --break-system-packages
31+
rm -rf /var/lib/apt/lists/*
32+
pip install uv
33+
INSTALL_UBUNTU_PYTHON
1634

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
2435
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
2536

2637
WORKDIR /app

0 commit comments

Comments
 (0)