It work
This commit is contained in:
parent
03e75b6c8e
commit
e5cf132d93
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
@ -0,0 +1,22 @@
|
|||
FROM docker.io/nvidia/cuda:11.8.0-devel-ubuntu22.04
|
||||
|
||||
ARG APT_MIRROR=https://mirrors.bfsu.edu.cn
|
||||
ARG ROOT_PASSWD=miao
|
||||
|
||||
RUN \
|
||||
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 && \
|
||||
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" ]
|
19
compose.yml
Normal file
19
compose.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
#--rm --device nvidia.com/gpu=all -it docker.io/nvidia/cuda:11.8.0-devel-ubuntu22.04 bash
|
||||
version: "3.9"
|
||||
name: "mcuda"
|
||||
services:
|
||||
main:
|
||||
container_name: mcuda
|
||||
image: "localhost/mcuda:latest"
|
||||
build:
|
||||
context: .
|
||||
dokerfile: ./Dockerfile
|
||||
cap_add:
|
||||
- AUDIT_WRITE
|
||||
- AUDIT_CONTROL
|
||||
devices:
|
||||
- "nvidia.com/gpu=all"
|
||||
ports:
|
||||
- "127.0.0.1:2022:22"
|
||||
volumes:
|
||||
- /home/leafee98/Desktop/home-research:/root
|
Loading…
Reference in a new issue