帕克胖夜话Docker-安装Docker Engine

准备

安装系统必要软件

1
2
3
4
5
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
$ lsb_release -a

添加安装docker engine的镜像源

查看操作系统版本

执行命令 lsb_release -a

1
2
3
4
5
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

创建镜像源文件

创建docker.list文件,文件路径 /etc/apt/sources.list.d/docker.list,根据操作系统的版本,来选择相关的镜像源头

1
2
3
4
5
6
7
8
On Ubuntu Precise 12.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-precise main
On Ubuntu Trusty 14.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-trusty main
Ubuntu Wily 15.10
deb https://apt.dockerproject.org/repo ubuntu-wily main
Ubuntu Xenial 16.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-xenial main

Docker安装

  • 更新 apt 包索引
    sudo apt-get update
  • 安装 docker
    sudo apt-get install docker-engine
  • 安装docker指定版本
    1
    2
    sudo apt-cache showpkg docker-engine
    apt-get install -y -q docker-engine=1.8.1-0~trusty
关注链智思维导图,最新文章主动推送
关注链智思维导图(linqmind)