安装Docker和Docker-compose

环境
ubuntu 16.04

1.

安装Docker Engine
删除旧版本
sudo apt-get remove docker docker-engine

Docker CE

1.让apt使用https

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

2.添加Docker’s official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

amd64

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

3.安装

sudo apt-get update
sudo apt-get install docker-ce

测试下良好运行
sudo docker run hello-world

Compose

curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

参考:
https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository
https://docs.docker.com/compose/install/

Show Comments