-
-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathDockerfile.common
More file actions
44 lines (37 loc) · 1.72 KB
/
Dockerfile.common
File metadata and controls
44 lines (37 loc) · 1.72 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
ARG UBUNTU_VERSION
FROM nvidia/cuda:12.8.1-base-ubuntu${UBUNTU_VERSION}.04
ARG _UV_HOME="/opt/uv"
ENV UV_INSTALL_DIR="${_UV_HOME}/bin"
ENV UV_MANAGED_PYTHON=1
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH="${UV_INSTALL_DIR}:${PATH}"
ENV OMPI_MCA_pml=^cm,ucx
ENV OMPI_MCA_btl=tcp,self
ENV OMPI_MCA_btl_tcp_if_exclude=lo,docker0
ENV NCCL_SOCKET_IFNAME=^docker,lo
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu${UBUNTU_VERSION}04/x86_64/3bf863cc.pub \
&& apt-get update --fix-missing \
&& apt-get upgrade -y \
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
&& apt-get install -y tzdata \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get install -y bzip2 ca-certificates curl build-essential git libglib2.0-0 libsm6 libxext6 libxrender1 mercurial openssh-server subversion wget \
libibverbs1 ibverbs-providers ibverbs-utils libibverbs-dev infiniband-diags \
&& sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config \
&& mkdir /run/sshd \
&& mkdir ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys \
&& chmod 600 ~/.ssh/authorized_keys \
&& rm /etc/ssh/ssh_host_* \
# User
&& apt-get install -y sudo \
&& groupadd -g 1000 dstack \
&& useradd -u 1000 -g 1000 -G sudo -s /bin/bash -m dstack \
&& echo 'dstack ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/dstack \
# Default working dir
&& mkdir -p /dstack/run \
&& chmod a+rwx /dstack/run \
# Cleanup
&& rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | INSTALLER_NO_MODIFY_PATH=1 sh \
&& uv python install --preview --default