Debian11安装Docker稳定版

1、安装依赖包

 apt-get update && apt-get install ca-certificates curl gnupg lsb-release apt-transport-https software-properties-common

2、安装GPG证书

 mkdir -m 0755 -p /etc/apt/keyrings \
     && curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

3、写入软件源信息

  echo \
     "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

4、安装 Docker

    chmod a+r /etc/apt/keyrings/docker.gpg && apt-get update

   apt-cache madison docker-ce # 查询存储库中可用的版本

  apt-get install docker-ce=5:23.0.1-1~debian.11~bullseye # Docker守护进程

  apt-get install docker-ce-cli=5:23.0.1-1~debian.11~bullseye # CLI工具用来远程控制Docker守护进程‎  

   apt-get install docker-compose && apt-get install docker-compose-plugin

   开机自启

  systemctl enable docker && systemctl restart docker && systemctl status docker

  docker info # 基本信息

 docker --version # 检查安装版本

你可能感兴趣的:(docker,容器,运维)