在Ubuntu升级Docker的方法

来源:互联网 发布:js给input赋值 编辑:程序博客网 时间:2024/05/19 06:14

2015-01-18 wcdj

摘要:在文章《体验DigitalOcean的VPS云服务》中实现了搭建一个Ubuntu 14.04的VPS操作系统环境,并使用Ubuntu 14.04版本官方软件源中已经自带的Docker包(docker.io)完成了Docker的安装,但是安装后的版本为1.0.1比较老,一些新的功能无法使用(比如,docker exec),本文记录升级到最新Docker的方法。

第一次的安装方法:(apt-get)

apt-get install -y docker.ioln -sf /usr/bin/docker.io /usr/local/bin/dockersed -i `$acomplete -F _docker docker` /etc/bash_completion.d/docker.io

安装的版本信息:



升级的方法:(从Docker官方源安装最新的版本,首先需要安装apt-transport-https,并添加Docker官方源)

sudo apt-get install apt-transport-https# Add the Docker repository key to your local keychainsudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9# Add the Docker repository to your apt sources list.sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"# update your sources listsudo apt-get update # 之后通过下面命令来安装最新版本的docker:apt-get install -y lxc-docker# 以后更新则:apt-get update -y lxc-dockerln -sf /usr/bin/docker /usr/local/bin/docker

升级后的版本信息:



参考

[1] Docker技术入门与实践

[2] https://docs.docker.com/installation/ubuntulinux/

[3] How to manage Linux containers with Docker on Ubuntu


0 0