ubuntu 安装 docker 和 cuda docker 镜像

Install Docker Engine on Ubuntu | Docker DocumentationInstructions for installing Docker Engine on Ubuntuhttps://docs.docker.com/engine/install/ubuntu/

通过仓库安装,要用国内源,否则速度很慢。

做cuda cudnn 之内的,可以选这个docker image:

nvidia/cuda: 10.2-cudnn7-devel-ubuntu18.04

11.3.0-cudnn8-devel-ubuntu20.04https://registry.hub.docker.com/layers/cuda/nvidia/cuda/11.3.0-cudnn8-devel-ubuntu20.04/images/sha256-a39884f8b39cb50f335881ef8662a3f21aa1be6a5087842f6baec81891f20501?context=explore




Install using the repository


1. Set up the repository

(1.)
sudo apt-get update

(2.)
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
			
(3.)		
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

(4.)
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null






2.Install docker-ce

(1.)
sudo apt-get update

(2.)
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

(1.`)
apt-cache madison docker-ce






sudo docker pull nvidia/cuda:11.6.0-devel-ubuntu20.04


export NEW_DIR=HelloPytorch     \
&& export WORK_SPACE=/home/opencl/ex/dockerWorkspace   \
&&  mkdir -p ${WORK_SPACE}/${NEW_DIR}    \
&& sudo docker run --name  ${NEW_DIR}_LHL -it                                                  \
-v  ${WORK_SPACE}/${NEW_DIR}:/${NEW_DIR}                                        \
-v /dev:/dev -v /usr/src/:/usr/src -v /lib/modules/:/lib/modules --privileged --cap-add=ALL  nvidia/cuda:11.6.0-devel-ubuntu20.04   /bin/bash






-------------------------------------------------------------------
In docker:
-------------------------------------------------------------------


mv /etc/apt/sources.list /etc/apt/sources.list.backupLL \
&& echo "deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list \
&& apt-get update && apt-get upgrade \
&& apt-get install vim



apt list python3
apt install python3

apt install python3-pip

你可能感兴趣的:(blas,ubuntu,docker,linux)