forked from eungbean/Docker-for-AI-Researcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-docker-setup.sh
49 lines (37 loc) · 1.49 KB
/
02-docker-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# DOCKER INSTALL
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
# Uninstall old versions
sudo apt-get remove -y docker docker-engine docker.io containerd runc
# Install using the repository
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
#Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#Verify that you now have the key with the fingerprint:
#9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
sudo apt-key fingerprint 0EBFCD88
#set up the stable repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
#Update the apt package index:
sudo apt-get update
#Install the latest version of Docker CE
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
apt-cache madison docker-ce
sudo usermod -aG docker $USER # 현재 접속중인 사용자에게 권한주기
# INSTALL NVIDIA-DOCKER2
# https://github.com/NVIDIA/nvidia-docker
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
#hello-world
sudo docker run hello-world