change Dockerfile style, use zsh as shell
This commit is contained in:
parent
1ac39cac41
commit
5f31d75038
|
@ -3,28 +3,30 @@ 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 && \
|
||||
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 && \
|
||||
&& 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 && \
|
||||
&& echo root:${ROOT_PASSWD} | chpasswd \
|
||||
\
|
||||
apt update && \
|
||||
apt install --yes ssh tini file neovim git && \
|
||||
apt clean && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
&& apt update \
|
||||
&& apt install --yes ssh tini zsh netcat file 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
|
||||
&& 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
|
||||
|
||||
ENTRYPOINT [ "/usr/bin/tini", "--" ]
|
||||
CMD [ "/usr/sbin/sshd", "-D" ]
|
||||
|
|
Loading…
Reference in a new issue