博客
关于我
Ubuntu 16.04安装docker详细步骤
阅读量:716 次
发布时间:2019-03-21

本文共 1046 字,大约阅读时间需要 3 分钟。

安装Docker CE的Apt源方法

Docker CE是开发人员和小型团队最理想的选择,安装过程相对简单。下文将详细介绍通过Apt源安装Docker CE的步骤。

###403.卸载旧版本

在开始新安装之前,务必要先卸载可能存在的旧版本。以下命令可删除Docker及相关组件:

sudo apt-get remove docker docker-engine docker-ce docker.io

###404.更新Apt索引

确保系统索引更新为最新状态:

sudo apt-get update

###405.安装必要依赖

Docker官方仓库支持HTTPS访问,因此我们需要先安装以下依赖包:

sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

###406.添加Docker官方GPG公钥

添加Docker官方GPG公钥以验证存储库:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

###407.添加Docker官方存储库

此处将添加Docker CE的官方存储库。请根据你的Ubuntu版本选择相应的命令:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

###408.更新存储库索引

在添加存储库后,更新apt索引以获取最新信息:

sudo apt-get update

###409.安装Docker CE

最后一步即安装Docker CE:

sudo apt-get install -y docker-ce

###410.验证安装

确认Docker是否安装成功,可以通过以下命令查看服务状态:

systemctl status docker

如果服务未启动,可使用以下命令启动:

sudo systemctl start docker

###411.运行经典Hello World

验证Docker运行正常,可运行经典Hello World演示:

sudo docker run hello-world

完成以上步骤后,你已成功安装并验证了Docker CE!

转载地址:http://ozbrz.baihongyu.com/

你可能感兴趣的文章
python3读取redis返回数据带有'b'的问题
查看>>
Python3连接MySQL
查看>>
Python关于isinstance函数的解析 | 附Demo(全)
查看>>
Python3:setup.py:完成所有任务的PIP安装(Build_ext+Install)
查看>>
python4.0 gil_Python 并发编程系列--1、浅谈GIL历史及对多线程的影响
查看>>
python60行绘图程序_天底下最简单的QT画图板,就一个类,60行代码
查看>>
Python: AES加密与解密
查看>>
Python: Range() 最大尺寸;动态的还是静态的?
查看>>
Python: Windows下用 multiprocessing 的深坑
查看>>
python:Could not find platform independent libraries <prefix>解决方法
查看>>
Python:datetime tzinfo 时区名称文档
查看>>
Python:deepcopy(list) vs new_list = old_list[:]
查看>>
Python:Google API - 从消息中获取 mimeTypes
查看>>
Python:Google API - 从消息中获取 mimeTypes
查看>>
Python:subprocess.call,stdout to file,stderr to file,在屏幕上实时显示stderr
查看>>
Python:TypeError:无法连接“str“和“int“对象
查看>>
Python:XPath 在 ElementTree 中不可用
查看>>
Python:从 FTP 服务器下载文件
查看>>
python:从列表中创建元组列表
查看>>
Python:从嵌套列表中删除重复项
查看>>