38 lines
1.5 KiB
Docker
38 lines
1.5 KiB
Docker
FROM docker.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
|
|
|
|
ARG APT_MIRROR=https://mirrors.bfsu.edu.cn
|
|
ARG ROOT_PASSWD=miao
|
|
|
|
RUN true \
|
|
&& env | grep -E -e '^NVIDIA' -e '^NV_' -e '^NVARCH' -e '^NCCL_' | \
|
|
sed -E 's/=(.*)/="\1"/' > \
|
|
/etc/profile.d/00-nvidia.sh \
|
|
&& echo "PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:\${PATH}" >> /etc/profile.d/00-nvidia.sh \
|
|
&& echo "LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64" >> /etc/profile.d/00-nvidia.sh \
|
|
&& echo "LIBRARY_PATH=/usr/local/cuda/lib64/stubs" >> /etc/profile.d/00-nvidia.sh \
|
|
&& sed -i 's/^/export /' /etc/profile.d/00-nvidia.sh \
|
|
\
|
|
&& sed -i "s#http://archive.ubuntu.com#${APT_MIRROR}#g" /etc/apt/sources.list \
|
|
&& sed -i "s#http://security.ubuntu.com#${APT_MIRROR}#g" /etc/apt/sources.list \
|
|
\
|
|
&& echo root:${ROOT_PASSWD} | chpasswd \
|
|
\
|
|
&& apt update \
|
|
&& apt install --yes ssh tini zsh netcat file git locales python3 python3-pip \
|
|
&& apt clean \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
\
|
|
&& sed -i '/C.UTF-8/s/^# //g' /etc/locale.gen \
|
|
&& locale-gen \
|
|
&& update-locale LANG=C.UTF-8 \
|
|
\
|
|
&& echo root:${ROOT_PASSWD} | chpasswd \
|
|
&& usermod --shell /usr/bin/zsh root \
|
|
\
|
|
&& mkdir /run/sshd \
|
|
&& sed -E -i 's/^.*StrictModes.*$/StrictModes no/' '/etc/ssh/sshd_config' \
|
|
&& sed -i 's/#PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
|
|
ENTRYPOINT [ "/usr/bin/tini", "--" ]
|
|
CMD [ "/usr/sbin/sshd", "-D", "-e" ]
|