本文最后更新于 2024-01-27,文章内容可能已经过时。

官方一键脚本(推荐)

curl -fsSL https://get.docker.com | bash -s docker

BASH

从系统源安装

apt install docker.io

BASH

docker-compose安装

将下面的内容全部复制到终端运行即可一键安装

国内脚本

curl -L https://mirror.ghproxy.com/https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-$(uname -s)-$(uname -m) >/usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

BASH

国外脚本

curl -L https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-$(uname -s)-$(uname -m) >/usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

BASH

验证安装

docker -v
docker-compose -v

BASH