-
Notifications
You must be signed in to change notification settings - Fork 6
/
install-prereqs-linux.sh
executable file
·46 lines (36 loc) · 1.51 KB
/
install-prereqs-linux.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
#!/bin/bash
sudo apt update -y
# Install VirtualBox
sudo apt-get install lsb_release virtualbox virtualbox-ext-pack -y
# Install Packer and Vagrant
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt update -y
sudo apt install packer vagrant -y
CROPT=${1:-nerdctl}
case $CROPT in
docker)
# Install Docker
sudo useradd -m docker && echo "docker:docker" | chpasswd
adduser docker sudo
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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
sudo apt update -y
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker $USER
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
docker run --rm hello-world
;;
nerdtcl)
cd /tmp
curl -LO https://github.com/containerd/nerdctl/releases/download/v0.14.0/nerdctl-full-0.14.0-linux-amd64.tar.gz
sudo tar Cxzvvf /usr/local nerdctl-full-0.14.0-linux-amd64.tar.gz
sudo systemctl enable --now containerd
containerd-rootless-setuptool.sh install
containerd-rootless-setuptool.sh install-buildkit
nerdctl container run --rm hello-world
;;
esac