Skip to content

Instantly share code, notes, and snippets.

@k8scat
Created September 6, 2025 08:48
Show Gist options
  • Select an option

  • Save k8scat/1c9ee26cdd5397ce3f6447e76b53dccd to your computer and use it in GitHub Desktop.

Select an option

Save k8scat/1c9ee26cdd5397ce3f6447e76b53dccd to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor > /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
# for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do apt-get remove -y $pkg; done
apt-get update -y || true
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment