-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup.sh
More file actions
executable file
·57 lines (45 loc) · 1.72 KB
/
Copy pathSetup.sh
File metadata and controls
executable file
·57 lines (45 loc) · 1.72 KB
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
50
51
52
53
54
55
56
57
#!/bin/bash
# Uninstall old versions
sudo apt-get -y remove \
containerd \
docker \
docker-compose \
docker-engine \
docker.io \
nvidia-container-runtime \
runc
# Install dependencies
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
# Add the docker repository GPG keys
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add docker repository
echo "deb [arch=amd64 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
# Install docker
sudo apt-get -y update
sudo apt-get -y install \
containerd.io \
docker-ce \
docker-ce-cli
# Retrieve the distribution
#distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
distribution="ubuntu20.04"
# Add the nvidia container runtime repository GPG keys
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
# Add the nvidia container runtime repository
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
# Install the nvidia container runtime
sudo apt-get -y update
sudo apt-get -y install nvidia-container-runtime
# Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Restart docker to apply all packages
sudo systemctl restart docker
# Build the image
sudo docker-compose build