近期用go开发发布平台整合k8s,在mac上编译好的linux binary放在测试机上却报

1
k8s Error response from daemon: client is newer than server (client API version: 1.32, server API version: 1.21

看起来是版本太低,需要进行升级,之前是通过docker-engine安装的
大概步骤是:

  1. 安装依赖:
1
apt-get install apt-transport-https ca-certificates
  1. 加装docker repo
1
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
  1. key
1
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
  1. 更新
1
apt-get update
  1. 安装
    发现ubuntu下有几种安装方法
1
2
3
apt-get install -y docker-engine
apt-get install -y lxc-docker
apt-get install -y docker.io

但是坑爹的是一个比一个版本老
要想更新至最新版本需要

1
wget -qO- https://get.docker.com/ | sh

这个安装的是最新的

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Client:
Version: 17.09.0-ce
API version: 1.32
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:42:38 2017
OS/Arch: linux/amd64

Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:41:20 2017
OS/Arch: linux/amd64
Experimental: false

在这种情况下可以

1
export DOCKER_API_VERSION=1.23

指定使用的版本
ubunturepo真的有人维护吗?