入门-docker安装

2017-06-15  本文已影响12人  ifeelok0319

Docker Community Edition for Debian

安装需求

Docker CE 支持以下64位的debian版本:

设置仓库

设置Docker CE仓库。uname -r查看系统内核版本,lsb_release -cs查看系统版本。

# Jessie or stretch
sudo apt-get -y install \
  apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

# Wheezy
sudo apt-get -y install \
  apt-transport-https \
    ca-certificates \
    curl \
    python-software-properties

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

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

sudo apt-get update

The version of add-apt-repository on Wheezy adds a deb-src repository that does not exist. You need to comment out this repository or running apt-get update will fail. Edit /etc/apt/sources.list. Find the line like the following, and comment it out or remove it:
deb-src [arch=amd64] https://download.docker.com/linux/debian wheezy stable
Save and exit the file.

获取docker CE

sudo apt-get -y install docker-ce

sudo systemctl start docker
# or
sudo service docker start

测试docker CE是否安装成功

sudo docker run hello-world
上一篇 下一篇

猜你喜欢

热点阅读