下面是从源代码编译最新(2018-03-27)的 docker/cli 和 moby 的详细过程
第1步 安装 ubuntu 16.04
下载最新的 ubuntu-16.04.4-desktop-amd64.iso
安装后
# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
# uname -a
Linux vbcomputer 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
NOTE: 本文档所有命令都使用 root 账户操作
第2步 更改 apt 安装源
# cat /etc/apt/sources.list
#deb包
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
第3步 安装 go 语言
https://studygolang.com/dl
下载
https://studygolang.com/dl/golang/go1.9.4.linux-amd64.tar.gz
NOTE: 必须是 go 1.9.4 , 不能用 go 1.10
tar xzvf go1.9.4.linux-amd64.tar.gz -C /usr/local/go
设置环境变量
/etc/bash.bashrc 最后增加
export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH
/root