From e5cf132d93e35d32b0ee791f29ae68bd880683a6 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Mon, 8 May 2023 17:21:44 +0800 Subject: [PATCH] It work --- Dockerfile | 22 ++++++++++++++++++++++ compose.yml | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Dockerfile create mode 100644 compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d9ce810 --- /dev/null +++ b/Dockerfile @@ -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" ] diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..faab0f6 --- /dev/null +++ b/compose.yml @@ -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