a82843e942
- persistent environments from nvidia into /etc/profile.d/00-nvidia.sh - add git and neovim as per-installed programs
31 lines
1.2 KiB
Docker
31 lines
1.2 KiB
Docker
FROM docker.io/nvidia/cuda:11.8.0-devel-ubuntu22.04
|
|
|
|
ARG APT_MIRROR=https://mirrors.bfsu.edu.cn
|
|
ARG ROOT_PASSWD=miao
|
|
|
|
RUN \
|
|
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 neovim git && \
|
|
apt clean && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
\
|
|
mkdir /run/sshd && \
|
|
sed -i 's/#PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config && \
|
|
sed -i 's#SSHD_OPTS=#SSHD_OPTS=""#' /etc/default/ssh
|
|
|
|
ENTRYPOINT [ "/usr/bin/tini", "--" ]
|
|
CMD [ "/usr/sbin/sshd", "-D" ]
|