install-gns3-debian12/install-docker.sh

35 lines
948 B
Bash
Raw 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)
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
true | apt-key fingerprint 0EBFCD88
true | add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
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