博客
关于我
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/

你可能感兴趣的文章
Mysql8.0注意url变更写法
查看>>
Mysql8.0的特性
查看>>
MySQL8修改密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
查看>>
MySQL8修改密码的方法
查看>>
Mysql8在Centos上安装后忘记root密码如何重新设置
查看>>
Mysql8在Windows上离线安装时忘记root密码
查看>>
MySQL8找不到my.ini配置文件以及报sql_mode=only_full_group_by解决方案
查看>>
mysql8的安装与卸载
查看>>
MySQL8,体验不一样的安装方式!
查看>>
MySQL: Host '127.0.0.1' is not allowed to connect to this MySQL server
查看>>
Mysql: 对换(替换)两条记录的同一个字段值
查看>>
mysql:Can‘t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock‘解决方法
查看>>
MYSQL:基础——3N范式的表结构设计
查看>>
MYSQL:基础——触发器
查看>>
Mysql:连接报错“closing inbound before receiving peer‘s close_notify”
查看>>
mysqlbinlog报错unknown variable ‘default-character-set=utf8mb4‘
查看>>
mysqldump 参数--lock-tables浅析
查看>>
mysqldump 导出中文乱码
查看>>
mysqldump 导出数据库中每张表的前n条
查看>>
mysqldump: Got error: 1044: Access denied for user ‘xx’@’xx’ to database ‘xx’ when using LOCK TABLES
查看>>