Update install docker

This commit is contained in:
khs1994
2017-12-09 00:12:02 +08:00
parent f60f4dd975
commit 9face881c7
4 changed files with 45 additions and 55 deletions

View File

@@ -28,14 +28,16 @@ $ sudo apt-get install \
software-properties-common
```
鉴于国内网络问题,强烈建议使用国内源,下面先介绍国内源的使用
#### 国内源
鉴于国内网络问题,强烈建议使用国内源,官方源请在注释中查看
为了确认所下载软件包的合法性,需要添加软件源的 GPG 密钥。
```bash
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/raspbian/gpg | sudo apt-key add -
# 官方源
# $ curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo apt-key add -
```
然后,我们需要向 `source.list` 中添加 Docker CE 软件源:
@@ -45,21 +47,17 @@ $ sudo add-apt-repository \
"deb [arch=armhf] https://mirrors.ustc.edu.cn/docker-ce/linux/raspbian \
$(lsb_release -cs) \
stable"
# 官方源
# $ sudo add-apt-repository \
# "deb [arch=armhf] https://download.docker.com/linux/raspbian \
# $(lsb_release -cs) \
# stable"
```
>以上命令会添加稳定版本的 Docker CE APT 镜像源,如果需要最新版本的 Docker CE 请将 stable 改为 edge 或者 test。从 Docker 17.06 开始edge test 版本的 APT 镜像源也会包含稳定版本的 Docker CE。
#### 官方源
```bash
$ curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=armhf] https://download.docker.com/linux/raspbian \
$(lsb_release -cs) \
stable"
```
#### 安装 Docker CE
更新 apt 软件包缓存,并安装 `docker-ce`