入门-docker安装

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容