美文网首页
入门-docker安装

入门-docker安装

作者: ifeelok0319 | 来源:发表于2017-06-15 23:50 被阅读12次

Docker Community Edition for Debian

安装需求

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

  • Debian stretch
  • Jessie 8.0
  • Wheezy 7.7

设置仓库

设置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

相关文章

网友评论

      本文标题:入门-docker安装

      本文链接:https://www.haomeiwen.com/subject/ohcpqxtx.html