compose/cuda/Dockerfile

39 lines
1.5 KiB
Docker
Raw Normal View History

FROM docker.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
2023-05-08 09:21:44 +00:00
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 \
2023-05-08 09:21:44 +00:00
\
&& echo root:${ROOT_PASSWD} | chpasswd \
2023-05-08 09:21:44 +00:00
\
&& apt update \
2023-07-04 02:59:38 +00:00
&& apt install --yes ssh tini zsh netcat file git locales python3 python3-pip \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* \
2023-05-08 09:21:44 +00:00
\
2023-05-14 14:32:19 +00:00
&& sed -i '/C.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=C.UTF-8 \
\
2023-07-04 03:00:52 +00:00
&& sed -E -i 's/^.*StrictModes.*$/StrictModes no/' '/etc/ssh/sshd_config' \
\
&& usermod --shell /usr/bin/zsh root \
\
&& mkdir /run/sshd \
&& sed -i 's/#PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i 's#SSHD_OPTS=#SSHD_OPTS=""#' /etc/default/ssh
2023-05-08 09:21:44 +00:00
ENTRYPOINT [ "/usr/bin/tini", "--" ]
2023-05-12 13:22:48 +00:00
CMD [ "/usr/sbin/sshd", "-D", "-e" ]