欢迎光临本站
我们一直在努力

Linux安装Docker。

如何在 linux 上安装 docker?步骤如下:检查先决条件:内核版本 3.10+、ram ≥ 2gb、稳定网络。安装依赖项:ubuntu/debian:apt-get install apt-transport-https…;centos/red hat:yum install yum-utils…添加 docker 官方仓库:ubuntu/debian:curl… | apt-key add -;centos/red hat:yum-config-manager –add-

linux怎么安装docker

如何在 Linux 上安装 Docker

第一步:检查先决条件

  • Linux 内核版本 3.10 或更高版本
  • 至少 2GB 的 RAM
  • 稳定的互联网连接

第二步:安装 Docker 依赖项

  • Ubuntu/Debian:

    sudo apt-get update
    sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    登录后复制

  • CentOS/Red Hat:

    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    登录后复制

第三步:添加 Docker 官方仓库

  • Ubuntu/Debian:

    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    登录后复制

  • CentOS/Red Hat:

    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    登录后复制

第四步:安装 Docker

  • Ubuntu/Debian:

    sudo apt-get update
    sudo apt-get install docker-ce
    登录后复制

  • CentOS/Red Hat:

    sudo yum install docker-ce
    登录后复制

第五步:启动 Docker

  • Ubuntu/Debian:

    sudo systemctl start docker
    登录后复制

    登录后复制

  • CentOS/Red Hat:

    sudo systemctl start docker
    登录后复制

    登录后复制

第六步:验证安装

运行以下命令检查 Docker 是否已成功安装:

docker run hello-world
登录后复制

如果看到类似于以下内容的输出,则表示 Docker 已成功安装:

Hello from Docker!
This message shows that your installation appears to be working correctly.
登录后复制

以上就是怎么安装的详细内容,更多请关注有卡有网。

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《Linux安装Docker。》
文章链接:https://www.youkayouwang.com/kaquan-baike/yunwei/151225.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。