Get Docker for Ubuntu

Check system version

root@Ubuntu16:~# uname -a
Linux Ubuntu16 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@Ubuntu16:~#
root@Ubuntu16:~# cat /proc/version
Linux version 4.8.0-36-generic (buildd@lgw01-18) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017
root@Ubuntu16:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
root@Ubuntu16:~#

1 - Install packages to allow apt to use a repository over HTTPS

root@Ubuntu16:~# apt-get install \
> apt-transport-https \
> ca-certificates \
> curl \
> software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
......
......
......
root@Ubuntu16:~#

2 - Add Docker’s official GPG key

root@Ubuntu16:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
root@Ubuntu16:~#
root@Ubuntu16:~# sudo apt-key fingerprint 0EBFCD88
pub 4096R/0EBFCD88 2017-02-22
密钥指纹 = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb) <docker@docker.com>
sub 4096R/F273FCD8 2017-02-22
root@Ubuntu16:~#

3 - Set up the stable repository

root@Ubuntu16:~# lsb_release -cs
xenial
root@Ubuntu16:~#
root@Ubuntu16:~# sudo add-apt-repository \
> "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
> $(lsb_release -cs) \
> stable"
root@Ubuntu16:~#

4 - Update the apt package index.

root@Ubuntu16:~# apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
获取:3 https://download.docker.com/linux/ubuntu xenial InRelease [20.1 kB]
获取:4 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [1,479 B]
命中:5 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:6 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
已下载 21.6 kB,耗时 18秒 (1,183 B/s)
正在读取软件包列表... 完成
root@Ubuntu16:~#

5 - Install the latest version of Docker CE

root@Ubuntu16:~# apt-get install docker-ce
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
aufs-tools cgroupfs-mount git git-man liberror-perl
建议安装:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch
git-cvs git-mediawiki git-svn
下列【新】软件包将被安装:
aufs-tools cgroupfs-mount docker-ce git git-man liberror-perl
升级了 0 个软件包,新安装了 6 个软件包,要卸载 0 个软件包,有 166 个软件包未被升级。
需要下载 23.1 MB/23.1 MB 的归档。
解压缩后会消耗 115 MB 的额外空间。
您希望继续执行吗? [Y/n] Y
获取:1 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 17.03.1~ce-0~ubuntu-xenial [19.3 MB]
获取:2 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 aufs-tools amd64 1:3.2+20130722-1.1ubuntu1 [92.9 kB]
获取:3 http://mirrors.aliyun.com/ubuntu xenial/main amd64 liberror-perl all 0.17-1.2 [19.6 kB]
获取:4 http://mirrors.aliyun.com/ubuntu xenial/main amd64 git-man all 1:2.7.4-0ubuntu1 [735 kB]
获取:5 http://mirrors.aliyun.com/ubuntu xenial/main amd64 git amd64 1:2.7.4-0ubuntu1 [3,006 kB]
已下载 23.1 MB,耗时 2分 20秒 (164 kB/s)
正在选中未选择的软件包 aufs-tools。
(正在读取数据库 ... 系统当前共安装有 181135 个文件和目录。)
正准备解包 .../aufs-tools_1%3a3.2+20130722-1.1ubuntu1_amd64.deb ...
正在解包 aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
正在选中未选择的软件包 cgroupfs-mount。
正准备解包 .../cgroupfs-mount_1.2_all.deb ...
正在解包 cgroupfs-mount (1.2) ...
正在选中未选择的软件包 docker-ce。
正准备解包 .../docker-ce_17.03.1~ce-0~ubuntu-xenial_amd64.deb ...
正在解包 docker-ce (17.03.1~ce-0~ubuntu-xenial) ...
正在选中未选择的软件包 liberror-perl。
正准备解包 .../liberror-perl_0.17-1.2_all.deb ...
正在解包 liberror-perl (0.17-1.2) ...
正在选中未选择的软件包 git-man。
正准备解包 .../git-man_1%3a2.7.4-0ubuntu1_all.deb ...
正在解包 git-man (1:2.7.4-0ubuntu1) ...
正在选中未选择的软件包 git。
正准备解包 .../git_1%3a2.7.4-0ubuntu1_amd64.deb ...
正在解包 git (1:2.7.4-0ubuntu1) ...
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
正在处理用于 systemd (229-4ubuntu16) 的触发器 ...
正在设置 aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
正在设置 cgroupfs-mount (1.2) ...
正在设置 docker-ce (17.03.1~ce-0~ubuntu-xenial) ...
正在设置 liberror-perl (0.17-1.2) ...
正在设置 git-man (1:2.7.4-0ubuntu1) ...
正在设置 git (1:2.7.4-0ubuntu1) ...
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
正在处理用于 systemd (229-4ubuntu16) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
root@Ubuntu16:~#

6 - HTTP/HTTPS proxy

https://docs.docker.com/engine/admin/systemd/

root@Ubuntu16:~# mkdir -p /etc/systemd/system/docker.service.d/
root@Ubuntu16:~# vim /etc/systemd/system/docker.service.d/http-proxy.conf
root@Ubuntu16:~# cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://10.144.1.10:8080"
Environment="HTTPS_PROXY=https://10.144.1.10:8080"
Environment="FTP_PROXY=ftp://10.144.1.10:8080"
root@Ubuntu16:~#
root@Ubuntu16:~# systemctl daemon-reload
root@Ubuntu16:~# systemctl restart docker
root@Ubuntu16:~#
root@Ubuntu16:~# systemctl show --property=Environment docker
Environment=HTTP_PROXY=http://10.144.1.10:8080 HTTPS_PROXY=https://10.144.1.10:8080 FTP_PROXY=ftp://10.144.1.10:8080
root@Ubuntu16:~#

7 - Verify that Docker CE

root@Ubuntu16:~# docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64 Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64
Experimental: false
root@Ubuntu16:~#
root@Ubuntu16:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
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.
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/ root@Ubuntu16:~#

8 - Configure Docker to start on boot

Post-installation steps for Linux

$ sudo systemctl enable docker

Install from a package

If you cannot use Docker’s repository to install Docker, you can download the .deb file for your release and install it manually. You will need to download a new file each time you want to upgrade Docker.

  1. This step is different for Docker CE

    Go to https://download.docker.com/linux/ubuntu/dists/,

    choose your Ubuntu version, browse to pool/stable/, choose either amd64 or armhf,and download the .deb file for the Docker version you want to install and for your version of Ubuntu.

  2. Install Docker, changing the path below to the path where you downloaded the Docker package.

    $ sudo dpkg -i /path/to/package.deb

    The Docker daemon starts automatically.

  3. Verify that Docker CE or Docker EE is installed correctly by running the hello-world image.

    $ sudo docker run hello-world

    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

Docker is installed and running. You need to use sudo to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.

Docker - 在Ubuntu16.04中安装Docker CE的更多相关文章

  1. 在Ubuntu16.04中安装Docker CE

    apt-get install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https ...

  2. docker学习笔记(一)—— ubuntu16.04下安装docker

    docker学习笔记(一)—— ubuntu16.04下安装docker 原创 2018年03月01日 14:53:00 标签: docker / ubuntu 1682 本文开发环境为Ubuntu ...

  3. SLAM+语音机器人DIY系列:(二)ROS入门——3.在ubuntu16.04中安装ROS kinetic

    摘要 ROS机器人操作系统在机器人应用领域很流行,依托代码开源和模块间协作等特性,给机器人开发者带来了很大的方便.我们的机器人“miiboo”中的大部分程序也采用ROS进行开发,所以本文就重点对ROS ...

  4. Docker - 在CentOS 7中安装Docker

    1-确认系统信息 # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # uname -a Linux CentOS-7 3. ...

  5. ubuntu16.04 在线安装docker ce

    官方文档:https://docs.docker.com/install/linux/docker-ce/ubuntu/   ubuntu创建普通用户: adduser dk001 给该用户添加sud ...

  6. ubuntu16.04 离线安装docker ce

    ubuntu离线安装 docker17.05.0-ce 离线安装 不想自己下载的小伙伴可以从以下地址下载几个软件包: 链接: https://pan.baidu.com/s/1lF7t7ciMhUnW ...

  7. ubuntu16.04下安装docker

    原文地址:传送门 本文开发环境为Ubuntu 16.04 LTS 64位系统,通过apt的docker官方源安装最新的Docker CE(Community Edition),即Docker社区版,是 ...

  8. Ubuntu16.04 部署安装Docker容器 & 注意事项

    一.部署安装Docker容器 1.1 Ubuntu下安装 crul sudo apt install curl curl是利用URL语法在命令行方式下工作的开源文件传输工具.它被广泛应用在Unix.多 ...

  9. ubuntu安装docker{ubuntu16.04下安装docker}

       一.开始安装 第一步:   由于apt官方库里的docker版本可能比较旧,所以先卸载可能存在的旧版本: $ sudo apt-get remove docker docker-engine d ...

随机推荐

  1. spring-AOP-基于Schema切面的小例子

    前言: 如果一个项目没有 jdk 5.0 , 那就无法使用基于@AspectJ 注解 的切面. 但是使用AspectJ的表达式的大门还是可以使用的. 我们可以用java提供的Schema配置方法,来替 ...

  2. WPF: 本地化(Localization) 实现

    本文将讨论一种较为方便的本地化方法. 由于在项目中要实现本地化,所以在网上查找相关的解决方案.通过一系列调研,发现实现本地化的方法主要有以下三种: 通过编译项目以设置 x:Uid 并使用 LocBam ...

  3. webStorm在Node.js平台下服务器配置及Express配置

    ************************************** 本博客从此篇开始,将从零基础开始逐渐深入地向各位博友分享node.js学习经验,如有需要请通过新浪微博@牙疼格尔联系博主, ...

  4. ECMAScript6-解构

    ▓▓▓▓▓▓ 大致介绍 解构:就是将声明的一组变量和与相同结构的数组或者对象的元素数值一一对应,并将变量相对应元素进行赋值 ▓▓▓▓▓▓ 数组解构 例子: let [a,b,c] = [1,2,3]; ...

  5. Android解析xml文件-采用DOM,PULL,SAX三种方法解析

    解析如下xml文件 <?xml version="1.0" encoding="UTF-8"?> <persons> <perso ...

  6. poptest老李谈分布式与集群 2

    集群分类 Linux集群主要分成三大类( 高可用集群, 负载均衡集群,科学计算集群) 高可用集群( High Availability Cluster)负载均衡集群(Load Balance Clus ...

  7. 老李秘技:LoadRunner支持参数文件极限是多大

    老李秘技:LoadRunner支持参数文件极限是多大   Controller不支持参数文件大于20m

  8. 老李推荐:第2章4节《MonkeyRunner源码剖析》了解你的测试对象: NotePad窗口Activity之菜单简介

    老李推荐:第2章4节<MonkeyRunner源码剖析>了解你的测试对象: NotePad窗口Activity之菜单简介   NotePad窗口Activity之菜单简介 这里我们总共用到 ...

  9. java小题:福尔摩斯的约会

    原题地址:https://www.nowcoder.com/pat/6/problem/4040 防止广告嫌疑,原题为: 题目描述 大侦探福尔摩斯接到一张奇怪的字条:"我们约会吧! 3485 ...

  10. CSS布局之-水平垂直居中

    对一个元素水平垂直居中,在我们的工作中是会经常遇到的,也是CSS布局中很重要的一部分,本文就来讲讲CSS水平垂直居中的一些方法.另外,文中的css都是用less书写的,如果看不懂less,可以把我给的 ...