install-gns3-debian12/install-docker.sh

31 lines
1.0 KiB
Bash
Raw Permalink Normal View History

2024-01-26 03:27:06 +02:00
#!/usr/bin/env bash
2024-01-26 06:03:30 +02:00
apt update
apt install -y \
2024-01-26 03:27:06 +02:00
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
lsb-release \
software-properties-common jq
DOCKER_COMPOSE_VERSION=$( curl -s 'https://api.github.com/repos/docker/compose/releases' |jq -r .[0].tag_name)
2024-01-26 06:25:52 +02:00
mkdir -p /usr/local/share/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor | dd of=/usr/local/share/keyrings/docker.gpg
2024-01-26 03:27:06 +02:00
2024-01-26 06:25:52 +02:00
echo "deb [signed-by=/usr/local/share/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docekr.list
2024-01-26 03:27:06 +02:00
2024-01-26 06:03:30 +02:00
apt update
2024-01-26 03:27:06 +02:00
2024-01-26 06:03:30 +02:00
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
2024-01-26 03:27:06 +02:00
if [ -f "docker-compose-linux-x86_64.xz" ];then
unxz docker-compose-linux-x86_64.xz
cp -v docker-compose-linux-x86_64 /usr/bin/docker-compose
else
curl -SL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64" -o /usr/bin/docker-compose
fi
chmod +x /usr/bin/docker-compose