-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·54 lines (40 loc) · 1.79 KB
/
setup.sh
File metadata and controls
executable file
·54 lines (40 loc) · 1.79 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
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
echo "[*] Updating apt..."
apt-get update -y
echo "[*] Installing prerequisites (ca-certificates, curl, gnupg, software-properties-common)..."
apt-get install -y ca-certificates curl gnupg software-properties-common apt-transport-https lsb-release
echo "[*] Setting up Docker APT keyring..."
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo "[*] Adding Docker repo..."
ARCH=$(dpkg --print-architecture)
CODENAME=$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
echo "deb [arch=${ARCH} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu ${CODENAME} stable" \
> /etc/apt/sources.list.d/docker.list
echo "[*] apt update (with Docker repo)..."
apt-get update -y
echo "[*] Installing Docker Engine + plugins..."
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
echo "[*] Removing any user-installed buildx override if arch mismatch..."
if [ -f "/home/zerrino/.docker/cli-plugins/docker-buildx" ]; then
rm -f /home/zerrino/.docker/cli-plugins/docker-buildx || true
fi
echo "[*] Enabling and starting Docker service..."
systemctl enable --now docker
echo "[*] Adding 'zerrino' to docker group so it can run docker without sudo..."
if id "zerrino" &>/dev/null; then
usermod -aG docker zerrino
fi
echo "[*] Installing GNS3 repo..."
add-apt-repository -y ppa:gns3/ppa
apt-get update -y
echo "[*] Installing GNS3 GUI + server..."
apt-get install -y gns3-gui gns3-server
echo "[*] Done."
echo "!! IMPORTANT: You must log out / log back in (or 'su - zerrino') before 'docker ps' works without sudo."