ubuntu安装docker详细步骤

您所在的位置:网站首页 ununtu安装docker ubuntu安装docker详细步骤

ubuntu安装docker详细步骤

2023-07-21 18:04| 来源: 网络整理| 查看: 265

这里建议大家使用阿里云的镜像源

第一步 安装所需的工具包sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common第二步 修改源文件权限sudo chmod 777 /etc/apt/sources.list //设置文件可读可写可执行第三步 将源文件内容替换成阿里源 如下:deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse第四步 添加阿里公钥 以便于访问仓库curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -第五步 添加Docker软件源echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list第六步 更新软件包缓存sudo apt-get update第七步 安装dockersudo apt-get install docker-engine第八部 启动dockersudo systemctl enable docker sudo systemctl start docker第9步 测试经典的hello world sudo docker run hello-world

执行 sudo docker run hello-world 的时候,如果你没有构建过这个hello-world镜像,或从其它地方拉取过这个镜像,docker自动去docker上拉取最新的hello-world 镜像

至此 docker安装完成



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3