参见:https://www.cnblogs.com/senlinyang/p/8203191.html

https://blog.csdn.net/qq_34906391/article/details/81478968

官方:https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1

Docker目前分为两个版本:
  • Docker Enterprise Edition (Docker EE) 专为企业开发和IT团队设计,用于在大规模生产中构建,运送和运行关键业务应用程序。Docker EE集成,认证和支持,为企业提供业界最安全的容器平台,使所有应用程序现代化。
  • Docker Community Edition (Docker CE) 是开发人员和小团队的理想选择,希望开始使用Docker并尝试基于容器的应用程序。Docker CE可在许多平台上使用,从桌面到云到服务器。

卸载版本的docker

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

安装可选内核模块

从 Ubuntu 14.04 开始,一部分内核模块移到了可选内核模块包 ( linux-image-extra-* ) ,以
减少内核软件包的体积。正常安装的系统应该会包含可选内核模块包,而一些裁剪后的系统
可能会将其精简掉。 AUFS 内核驱动属于可选内核模块的一部分,作为推荐的 Docker 存储层
驱动,一般建议安装可选内核模块包以使用 AUFS 。如果没有安装的话可以使用下面的命令安装

sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual

安装Docker CE

由于 apt 源使用 HTTPS 以确保软件下载过程中不被篡改。因此,我们首先需要添加使用
HTTPS 传输的软件包以及 CA 证书。

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

鉴于国内网络问题,强烈建议使用国内源,官方源请在注释中查看。为了确认所下载软件包的合法性,需要添加软件源的 GPG 密钥

curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 官方源
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

然后,我们需要向 source.list 中添加 Docker 软件源

sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable" # 官方源
# sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) \
# stable

更新 apt 软件包缓存,并安装 docker-ce

sudo apt-get update
sudo apt-get install docker-ce

启动docker CE

sudo systemctl enable docker
sudo systemctl start docker

测试安装是否正确

sudo docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:445b2fe9afea8b4aa0b2f27fe49dd6ad130dfe7a8fd0832be5de99625dad47cd
Status: Downloaded newer image for hello-world:latest Hello from Docker!
This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal. To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/ For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

如果出现上述信息,说明安装成功

镜像加速

由于国外的镜像有时候网络访问过慢,需要使用国内的镜像加速

对于使用 systemd 的系统,请在 /etc/docker/daemon.json 中写入如下内容(如果文件不存
在请新建该文件)

{
"registry-mirrors": [
"https://registry.docker-cn.com"
]
}

之后重启启动系统

sudo systemctl daemon-reload
sudo systemctl restart docker

Uninstall Docker CE

Uninstall the Docker CE package:

$ sudo apt-get purge docker-ce

Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:

$ sudo rm -rf /var/lib/docker

You must delete any edited configuration files manually.

Ubuntu 16.04下docker ce的安装(待完善)的更多相关文章

  1. Ubuntu 16.04下docker ce的安装

    卸载版本的docker sudo apt-get remove docker docker-engine docker.io 安装可选内核模块 从 Ubuntu 14.04 开始,一部分内核模块移到了 ...

  2. Ubuntu 16.04下EasyOpenJTAG+OpenOCD的安装和使用【转】

    本文转载自:http://www.linuxdiyf.com/linux/24086.html Ubuntu 16.04下EasyOpenJTAG+OpenOCD的安装和使用 发布时间:2016-09 ...

  3. Ubuntu(16.04) 下如何修改(安装)arm-linux-gcc编译器

    ubuntu下如何修改(安装)arm-linux-gcc编译器 将gcc解压到根目录 sudo tar xjf arm-linux-gcc-4.3.2.tar.bz2 -C / 查看原来的环境变量 e ...

  4. Ubuntu 16.04下deb文件的安装

    pkg 是Debian Package的简写,是为Debian 专门开发的套件管理系统,方便软件的安装.更新及移除.所有源自Debian的Linux发行版都使用dpkg,例如Ubuntu.Knoppi ...

  5. ubuntu 16.04下node和pm2安装

    一.安装node,这里安装9.0的版本,安装其它版本直接到https://deb.nodesource.com/setup_9.x找相应版本的更改既可 1.sudo apt-get remove no ...

  6. Ubuntu 16.04 下简单安装使用golang之备忘

      刚开始学习Go语言,这里记录下我在Ubuntu 16.04下安装使用golang的过程,方便以后查询.   一.安装   1.添加源   如果使用默认的源安装golang的话,版本太低,只到1.6 ...

  7. Ubuntu 16.04下编译安装Apache2.4和PHP7结合

    Ubuntu 16.04下编译安装Apache2.4和PHP7结合,并安装PDOmysql扩展. 1.编译安装apache2.4.20 1 第一步: ./configure --prefix=/usr ...

  8. Ubuntu 16.04下安装MacBuntu 16.04 TP 变身Mac OS X主题风格

    Ubuntu 16.04下安装MacBuntu 16.04 TP 变身Mac OS X主题风格 sudo add-apt-repository ppa:noobslab/macbuntu sudo a ...

  9. Ubuntu 16.04 下使用Xampp

    Ubuntu 16.04 下使用Xampp 什么是Xampp? XAMPP(Apache+MySQL+PHP+PERL) 是一个功能强大的建站集成软件包.这个软件包原来的名字是 LAMPP,但是为了避 ...

随机推荐

  1. 《linux内核设计分析》 第一周作业

    linux 基础入门 课程总结 一.linux系统简介 linux操作系统 整个计算机可以分为 硬件 内核 系统调用 应用程序 操作系统就属于内核和系统调用这两部分 操作系统历史发展 批处理操作系统 ...

  2. [c/c++] programming之路(4)、常量和变量

    一.打开多个程序(温习) #include<stdio.h> #include<stdlib.h> void main(){ ; ]; scanf("%d" ...

  3. alloc_skb申请函数分析

    alloc_skb()用于分配缓冲区的函数.由于"数据缓冲区"和"缓冲区的描述结构"(sk_buff结构)是两种不同的实体,这就意味着,在分配一个缓冲区时,需要 ...

  4. topcoder srm list

    300 305 310 315 320 325 330 335 340 350 360 370 380 390 400 410 415 420 425 430 435 440 445 450 455 ...

  5. Oracle使用——Oracle表空间处理

    创建表空间 查看表空间信息(名称.大小)  select t1.name tablespace_name ,t2.name file_local ,t2.bytes / (1024 * 1024) f ...

  6. P1552 [APIO2012]派遣

    链接 https://www.luogu.org/problemnew/show/P1552 思路 忍者数量肯定越多越好 那就从下到上的合并它的孩子 左偏树的话 顺便维护一个tot,大头堆,如果tot ...

  7. vs2015 + Python3.5 环境搭建

    1. vs2015只支持Python3.5及以前的版本,对应Anaconda3.4.2之前的版本. 2. 卸载掉所有安装过的Python 3. 建议重装VS2015, 因为增量升级Python Too ...

  8. 操作系统04_IO管理

    输入输出系统 IO系统的层次结构 用户层IO软件 设备独立性软件 设备驱动程序 中断处理程序 对IO设备的控制方式 使用轮询的可编程IO方式 cpu不停地检查设备的状态,以字节为单位,非中断方式,利用 ...

  9. GPIO实验之c语言

    上一章节进行实验使用的是汇编进行编程的,本次实验是使用c语言进行编写的. (1)点亮一个led灯   1)启动文件:    crt.S   .text   .global _start   _star ...

  10. 【.Net】结合项目谈谈多线程

    提到多线程, 大家都知道, 在进程中启用多个线程进行工作, 会提升程序的效率等等. 本篇文章旨在解释多线程的基础概念之外, 还要结合实际的项目来谈多线程的具体使用. Thread 我们知道启动一个线程 ...