Skip to main content

docker docker-compose 安装

docker 脚本安装

  1. 下载安装脚本
 curl -fsSL https://get.docker.com -o get-docker.sh
  1. 运行安装脚本
 sudo sh get-docker.sh
  1. 确认 docker 是否允许
systemctl status docker
  1. 设置 docker 开机自启
systemctl enable docker

docker-compose 脚本安装

  1. 下载 docker-compose
curl -SL https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
  1. 添加 docker-compose 命令
chmod +x /usr/local/bin/docker-compose
  1. 显示 docker-compose 版本
docker-compose -v