translate install/raspberry-pi.md

This commit is contained in:
Dorsey.Xu 2020-10-26 15:03:45 +08:00
parent 6c8e710c53
commit b54b5b0a0f
3 changed files with 33 additions and 32 deletions

View File

@ -72,7 +72,7 @@ $ sudo yum install docker-ce
### Install with Automatic Scripts
To simplify the installation process during test or development, Docker official provides a convenient installation script, you can install docker on Fedora with the following script:
To simplify the installation process during test or development, Docker official provides a convenient installation script, you can install docker on CentOS with the following script:
```bash
$ curl -fsSL get.docker.com -o get-docker.sh

View File

@ -67,7 +67,7 @@ $ sudo add-apt-repository \
#### Install Docker CE
Update apt cache and install `docker-ce`
Update apt cache and install `docker-ce`.
```bash
$ sudo apt-get update

View File

@ -1,20 +1,21 @@
## 树莓派卡片电脑安装 Docker CE
## Install Docker CE on Raspberry Pi SoC
>警告切勿在没有配置 Docker APT 源的情况下直接使用 apt 命令安装 Docker.
> WARNING: DO NOT install Docker with apt directly without configuring apt source.
### 系统要求
Docker CE 不仅支持 `x86_64` 架构的计算机同时也支持 `ARM` 架构的计算机本小节内容以树莓派单片电脑为例讲解 `ARM` 架构安装 Docker CE
### OS Requirement
Docker CE 支持以下版本的 [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) 操作系统:
Docker CE supports not only `x86_64` architecture computers, but also `ARM` ones. In this section, we will take Raspberry Pi SoC as an example to explain how to install Docker CE on `ARM` computers.
Docker CE supports the following [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) versions.
* Raspbian Stretch
** `Raspbian` 是树莓派的开发与维护机构 [树莓派基金会](http://www.raspberrypi.org/) 推荐用于树莓派的首选系统,其基于 `Debian`。
*NOTE:* `Raspbian` is the top OS on Raspberry Pi recommended by [Raspberry Pi Foundation](https://www.raspberrypi.org/), which is the development and maintenance organization for Raspberry Pi. Raspbian is based on `Debian`.
### 使用 APT 安装
### Install with apt
由于 apt 源使用 HTTPS 以确保软件下载过程中不被篡改因此我们首先需要添加使用 HTTPS 传输的软件包以及 CA 证书
Since the apt source uses HTTPS to make sure that the software is not modified maliciously during download, we have to add the apt source via HTTPS as well as the CA certificate.
```bash
$ sudo apt-get update
@ -28,19 +29,19 @@ $ sudo apt-get install \
software-properties-common
```
鉴于国内网络问题强烈建议使用国内源官方源请在注释中查看
Due to the network issues in China mainland, it is highly recommended for Chinese users to use Chinese sources. Please refer to the official sources in the comments(they are replaced by a Chinese source).
为了确认所下载软件包的合法性需要添加软件源的 GPG 密钥
To verify the validity of the package downloaded, we have to add the GPG key for the package source.
```bash
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/raspbian/gpg | sudo apt-key add -
# 官方源
# Official source
# $ curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo apt-key add -
```
然后我们需要向 `source.list` 中添加 Docker CE 软件源
After that, we need to add the Docker CE source to `source.list`:
```bash
$ sudo add-apt-repository \
@ -49,18 +50,18 @@ $ sudo add-apt-repository \
stable"
# 官方源
# Official Source
# $ sudo add-apt-repository \
# "deb [arch=armhf] https://download.docker.com/linux/raspbian \
# $(lsb_release -cs) \
# stable"
```
>以上命令会添加稳定版本的 Docker CE APT 如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly
> The above commands will add the APT source for the stable version of Docker CE. If you need the `test` or `nightly` source, please replace with them to meet your own needs.
#### 安装 Docker CE
#### Install Docker CE
更新 apt 软件包缓存并安装 `docker-ce`
Update apt cache and install `docker-ce`.
```bash
$ sudo apt-get update
@ -68,43 +69,43 @@ $ sudo apt-get update
$ sudo apt-get install docker-ce
```
### 使用脚本自动安装
### Install with Automatic Scripts
在测试或开发环境中 Docker 官方为了简化安装流程提供了一套便捷的安装脚本Raspbian 系统上可以使用这套脚本安装
To simplify the installation process during test or development, Docker official provides a convenient installation script, you can install docker on Raspbian with the following script:
```bash
$ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun
```
执行这个命令后脚本就会自动的将一切准备工作做好并且把 Docker CE Edge 版本安装在系统中
After execution, the script will have everything prepared, and have installed the stable version on your OS.
### 启动 Docker CE
### Start Docker CE
```bash
$ sudo systemctl enable docker
$ sudo systemctl start docker
```
### 建立 docker 用户组
### Add Docker Usergroups
默认情况下`docker` 命令会使用 [Unix socket](https://en.wikipedia.org/wiki/Unix_domain_socket) 与 Docker 引擎通讯。而只有 `root` 用户和 `docker` 组的用户才可以访问 Docker 引擎的 Unix socket。出于安全考虑一般 Linux 系统上不会直接使用 `root` 用户。因此,更好地做法是将需要使用 `docker` 的用户加入 `docker` 用户组。
Command `docker` uses [Unix socket](https://en.wikipedia.org/wiki/Unix_domain_socket) to communicate with Docker engine by default. Only users of `root` and `docker` groups can communicate with Unix socket of the Docker engine.`root` user is not directly used on Linux systems in general for security. Therefore, it is better to add users who need to use `docker` to the `docker` user group.
建立 `docker`
create `docker` group:
```bash
$ sudo groupadd docker
```
将当前用户加入 `docker`
add current user to `docker` group:
```bash
$ sudo usermod -aG docker $USER
```
退出当前终端并重新登录进行如下测试
Exit current terminal and relogin to test.
### 测试 Docker 是否安装正确
### Verify the Installation
```bash
$ docker run arm32v7/hello-world
@ -137,10 +138,10 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/
```
若能正常输出以上信息则说明安装成功
If it shows the above message, it means your installation is successful.
*注意* ARM 平台不能使用 `x86` 镜像查看 Raspbian 可使用镜像请访问 [arm32v7](https://hub.docker.com/u/arm32v7/)
*NOTE:* ARM platform cannot use `x86` mirrors, to view a list of the mirrors supported on Raspbian, please visit [arm32v7](https://hub.docker.com/u/arm32v7/).
### 镜像加速
### Registry Mirror(In China)
如果在使用过程中发现拉取 Docker 镜像十分缓慢可以配置 Docker [国内镜像加速](mirror.md)
If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).