2016-04-29 93 views
12

我正在尝试运行docker和docker-compose的最新稳定版本。Ubuntu和更新Docker

我下面就https://docs.docker.com/engine/installation/linux/ubuntulinux/

的说明显然泊坞窗,撰写的最新版本是1.7。

然而,通过文件运行,安装搬运工引擎之后,然后我得到:

$ docker-compose --version 
docker-compose version: 1.4.0 

而且

$ docker --version 
Docker version 1.11.1, build 5604cbe 

当我尝试更新,我得到如下:

$ sudo apt-get upgrade docker-engine 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Calculating upgrade... docker-engine is already the newest version. 
Done 

更新

这只是越来越陌生。在尝试了下面的所有建议之后,我现在可以得到:

$ docker-compose -v 
The program 'docker-compose' is currently not installed. You can install it by typing: 
sudo apt-get install docker-compose 
[email protected]:~$ sudo apt-get install docker-compose 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
docker-compose is already the newest version. 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 

那我怎么能更新docker?

感谢

+0

你运行'sudo易于得到前update''sudo易于得到upgrade'? –

+0

是的,我已经做到了。 – Magick

回答

12

试试这个东西:

sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" 
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list" 
sudo aptitude update 
sudo aptitude install lxc-docker 

如果不工作,让通过第三方做:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 
$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" 
$ sudo apt-get update 
$ sudo apt-get install lxc-docker 
+0

但是,当我这样做时,我会得到完全相同的结果。版本始终为'docker -v Docker版本1.11。1,build 5604cbe ' – Magick

+0

你是否先删除了所有的提包? 'sudo易于得到删除泊坞窗*' 按照这个也许 http://linoxide.com/linux-how-to/install-upgrade-docker-1-7/ –

+1

是,现在正在重新安装搬运工-引擎,撰写版本已经关闭了! '$ docker-compose -v docker-compose version:1.3.1' – Magick

1

你现在要做的是更新泊坞窗因为你的码头是最新的。

https://docs.docker.com/compose/install/

卷曲-L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`UNAME -s ' - ' UNAME -m”>的/ usr/local/bin中/搬运工-组成

使用chmod + X的/ usr/local/bin中/ docker-compose

+0

当我尝试这个,我得到'$卷曲-L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-uname -S-uname -m输出>在/ usr/local/bin目录/ docker-compose curl:选项-s-uname:未知' – Magick

+0

我忘记了报价只需在官方网站上关注它... https://docs.docker.com/compose/install/ curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose 'uname -S命令' - 'uname -m输出'>的/ usr/local/bin目录/泊坞窗,构成 – new

+0

现在,我得到'卷曲:选项-m:需要参数 – Magick

21

因为我在这上面失去了半个小时,也许它会帮助那里的一些人。 我不得不这样做升级我的版本是:

curl -L "https://github.com/docker/compose/releases/download/1.13.0/docker-compose-$(uname -s)-$(uname -m)" > ./docker-compose 
sudo mv ./docker-compose /usr/bin/docker-compose 
sudo chmod +x /usr/bin/docker-compose 

使用the last version of docker compose而不是1.13.0

+0

你救了我一天:)谢谢 – user1501382

0
This is a problem when you have docker installed as latest version and docker-compose is old version 
try docker-compose -V if it gives old version then you have to uninstall via  `Pip` 

`pip uninstall docker-compose` most of the time you uninstall with the same tool how you installed old version 

it might give some error and partial uninstall 
Just restart ubuntu and then install docker from 
https://docs.docker.com/engine/installation/ 

check docker compose version again hopefully its latest and compatible with docker 
See the install docs for more install options and instructions. 

Compose file format compatibility matrix 

Compose file format Docker Engine 
3.0 ; 3.1 1.13.0+ 
2.1   1.12.0+ 
2.0   1.10.0+ 
1.0   1.9.1+ 
Changes 
0

这似乎对我有用,似乎很简单。

sudo apt-get update 
sudo apt-get upgrade docker-ce 

结果在下面

docker-ce is already the newest version.