Merge pull request #470 from Bill0412/english

Translate the install chapter to English
pull/475/head
Kang Huaishuai 2020-10-26 17:09:50 +08:00 committed by GitHub
commit 2ae8979c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 199 additions and 200 deletions

View File

@ -1,7 +1,7 @@
# Docker # Docker Installation
Docker CE EE CE 7 EE 使 24 Docker has 2 major editions, CE and EE. CE is the Community Edition(free, 7 month as a support cycle), while EE is the Enterprise Edition, which emphasizes on security, paid membership, and the support cycle is 24 months.
Docker CE **stable**, **test**, **nightly** **stable** (18.09, 19.03, 19.09...) Docker CE has 3 update channels, **stable**, **test** and **nightly**, and releases a **stable** version every other 6 months(18.09, 19.03, 19.09...).
[](https://docs.docker.com/engine/installation/),这里主要介绍 Docker CE 在 Linux 、Windows 10 (PC) 和 macOS 上的安装。 You can find the [Installation Guidance](https://docs.docker.com/engine/installation/) at the official website. We mainly introduce Docker CE installation on Linux, Windows 10(PC) and macOS here.

View File

@ -1,16 +1,15 @@
## CentOS Docker CE ## Install Docker CE on CentOS
> Docker YUM 使 yum Docker. > WARNING: DO NOT install Docker with yum directly without configuring yum source.
### ### Prerequisites
#### #### OS Requirement
Docker CE supports 64-bit version of CentOS 7, and it requires the kernel version to be no older than 3.10. CentOS 7 satisfies the minimum kernel version requirement. But due to the comparatively old kernel, some of the functionalities like `overlay2` are unable to be used, and some other features may be unstable.
Docker CE 64 CentOS 7 3.10 CentOS 7 `overlay2` 使 #### Uninstall the Old Versions
#### The old versions of Docker are called `docker` or `docker-engine`, you can have them uninstalled with the following command:
Docker `docker` `docker-engine`使
```bash ```bash
$ sudo yum remove docker \ $ sudo yum remove docker \
@ -25,9 +24,9 @@ $ sudo yum remove docker \
docker-engine docker-engine
``` ```
### 使 yum ### Install with yum
Use the following commands to install the dependencies:
```bash ```bash
$ sudo yum install -y yum-utils \ $ sudo yum install -y yum-utils \
@ -35,80 +34,79 @@ $ sudo yum install -y yum-utils \
lvm2 lvm2
``` ```
使 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).
`yum`
Use the following command to add `dnf` source.
```bash ```bash
$ sudo yum-config-manager \ $ sudo yum-config-manager \
--add-repo \ --add-repo \
https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
# # Official source
# $ sudo yum-config-manager \ # $ sudo yum-config-manager \
# --add-repo \ # --add-repo \
# https://download.docker.com/linux/centos/docker-ce.repo # https://download.docker.com/linux/centos/docker-ce.repo
``` ```
Docker CE 使 If you want to use the `test` version of Docker CE, use the following command:
```bash ```bash
$ sudo yum-config-manager --enable docker-ce-test $ sudo yum-config-manager --enable docker-ce-test
``` ```
Docker CE 使 As for `nightly` version:
```bash ```bash
$ sudo yum-config-manager --enable docker-ce-nightly $ sudo yum-config-manager --enable docker-ce-nightly
``` ```
#### Docker CE #### Install Docker CE
`yum` `docker-ce` Update `yum` source cacheand then install `docker-ce`.
```bash ```bash
$ sudo yum makecache fast $ sudo yum makecache fast
$ sudo yum install docker-ce $ sudo yum install docker-ce
``` ```
### 使 ### Install with Automatic Scripts
Docker 便CentOS 使 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 ```bash
$ curl -fsSL get.docker.com -o get-docker.sh $ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun $ 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 ```bash
$ sudo systemctl enable docker $ sudo systemctl enable docker
$ sudo systemctl start 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 ```bash
$ sudo groupadd docker $ sudo groupadd docker
``` ```
`docker` add current user to `docker` group:
```bash ```bash
$ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
``` ```
退 Exit current terminal and relogin to test.
### Docker ### Verify the Installation
```bash ```bash
$ docker run hello-world $ docker run hello-world
@ -141,22 +139,22 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/ https://docs.docker.com/get-started/
``` ```
If it shows the above message, it means your installation is successful.
### ### Registry Mirror(In China)
使 Docker Docker [](mirror.md) If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).
### ### Add kernel Parameters
CentOS 使 Docker CE If you see the following warnings when using Docker CE,
```bash ```bash
WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled WARNING: bridge-nf-call-ip6tables is disabled
``` ```
Please add the kernel parameters to enable these features.
```bash ```bash
$ sudo tee -a /etc/sysctl.conf <<-EOF $ sudo tee -a /etc/sysctl.conf <<-EOF
@ -165,12 +163,12 @@ net.bridge.bridge-nf-call-iptables = 1
EOF EOF
``` ```
`sysctl.conf` Then reload the `sysctl.confg`
```bash ```bash
$ sudo sysctl -p $ sudo sysctl -p
``` ```
### ### References
* [Docker CentOS ](https://docs.docker.com/install/linux/docker-ce/centos/) * [Docker Official Installation Documents for Fedora](https://docs.docker.com/install/linux/docker-ce/centos/)

View File

@ -1,19 +1,18 @@
## Debian Docker CE ## Install Docker CE on Debian
> WARNING: DO NOT install Docker with apt directly without configuring apt source.
> Docker APT 使 apt Docker. ### Prerequisites
### #### OS Requirement
#### Docker CE supports the following [Debian](https://www.debian.org/intro/about) versions.
Docker CE [Debian](https://www.debian.org/intro/about) 操作系统:
* Buster 10 * Buster 10
* Stretch 9 * Stretch 9
#### #### Uninstall the Old Versions
Docker `docker` `docker-engine`使 The old versions of Docker are called `docker` or `docker-engine`, you can have them uninstalled with the following command:
```bash ```bash
$ sudo apt-get remove docker \ $ sudo apt-get remove docker \
@ -21,9 +20,9 @@ $ sudo apt-get remove docker \
docker.io docker.io
``` ```
### 使 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 ```bash
$ sudo apt-get update $ sudo apt-get update
@ -37,19 +36,19 @@ $ sudo apt-get install \
software-properties-common 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 ```bash
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg | sudo apt-key add - $ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg | sudo apt-key add -
# # Official source
# $ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - # $ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
``` ```
`source.list` Docker CE After that, we need to add the Docker CE source to `source.list`:
```bash ```bash
$ sudo add-apt-repository \ $ sudo add-apt-repository \
@ -57,18 +56,18 @@ $ sudo add-apt-repository \
$(lsb_release -cs) \ $(lsb_release -cs) \
stable" stable"
# # Official source
# $ sudo add-apt-repository \ # $ sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/debian \ # "deb [arch=amd64] https://download.docker.com/linux/debian \
# $(lsb_release -cs) \ # $(lsb_release -cs) \
# stable" # 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 ```bash
$ sudo apt-get update $ sudo apt-get update
@ -76,43 +75,43 @@ $ sudo apt-get update
$ sudo apt-get install docker-ce $ sudo apt-get install docker-ce
``` ```
### 使 ### Install with Automatic Scripts
Docker 便Debian 使 To simplify the installation process during test or development, Docker official provides a convenient installation script, you can install docker on Debian with the following script:
```bash ```bash
$ curl -fsSL get.docker.com -o get-docker.sh $ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun $ 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 ```bash
$ sudo systemctl enable docker $ sudo systemctl enable docker
$ sudo systemctl start 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 ```bash
$ sudo groupadd docker $ sudo groupadd docker
``` ```
`docker` add current user to `docker` group:
```bash ```bash
$ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
``` ```
退 Exit current terminal and relogin to test.
### Docker ### Verify the Installation
```bash ```bash
$ docker run hello-world $ docker run hello-world
@ -145,12 +144,12 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/ https://docs.docker.com/get-started/
``` ```
If it shows the above message, it means your installation is successful.
### ### Registry Mirror(In China)
使 Docker Docker [](mirror.md) If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).
### ### References
* [Docker Debian ](https://docs.docker.com/install/linux/docker-ce/debian/) * [Docker Official Installation Documents for Debian](https://docs.docker.com/install/linux/docker-ce/debian/)

View File

@ -1,20 +1,21 @@
## Fedora Docker CE ## Install Docker CE on Fedora
> Docker dnf 使 dnf Docker. > WARNING: DO NOT install Docker with dnf directly without configuring dnf source.
### ### Prerequisites
#### #### OS Requirement
Docker CE [Fedora](https://fedoraproject.org/) 操作系统:
Docker CE supports the following [Fedora](https://fedoraproject.org/) versions:
* 28 * 28
* 29 * 29
* 30 * 30
#### #### Uninstall the Old Versions
Docker `docker` `docker-engine`使 The old versions of Docker are called `docker` or `docker-engine`, you can have them uninstalled with the following command:
```bash ```bash
$ sudo dnf remove docker \ $ sudo dnf remove docker \
@ -29,17 +30,16 @@ $ sudo dnf remove docker \
docker-engine docker-engine
``` ```
### 使 dnf ### Install with dnf
Execute the following command to install the dependencies.
```bash ```bash
$ sudo dnf -y install dnf-plugins-core $ sudo dnf -y install dnf-plugins-core
``` ```
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).
使 Use the following command to add `dnf` source.
`dnf`
```bash ```bash
$ sudo dnf config-manager \ $ sudo dnf config-manager \
@ -47,40 +47,40 @@ $ sudo dnf config-manager \
https://mirrors.ustc.edu.cn/docker-ce/linux/fedora/docker-ce.repo https://mirrors.ustc.edu.cn/docker-ce/linux/fedora/docker-ce.repo
# # Official source
# $ sudo dnf config-manager \ # $ sudo dnf config-manager \
# --add-repo \ # --add-repo \
# https://download.docker.com/linux/fedora/docker-ce.repo # https://download.docker.com/linux/fedora/docker-ce.repo
``` ```
Docker CE 使 If you want to use the `test` version of Docker CE, use the following command:
```bash ```bash
$ sudo dnf config-manager --set-enabled docker-ce-test $ sudo dnf config-manager --set-enabled docker-ce-test
``` ```
Docker CE 使 As for `nightly` version:
```bash ```bash
$ sudo dnf config-manager --set-enabled docker-ce-nightly $ sudo dnf config-manager --set-enabled docker-ce-nightly
``` ```
Docker CE You are also free to disable the test version of Docker CE:
```bash ```bash
$ sudo dnf config-manager --set-disabled docker-ce-test $ sudo dnf config-manager --set-disabled docker-ce-test
``` ```
#### Docker CE #### Install Docker CE
`dnf` `docker-ce` Update `dnf` source cacheand then install `docker-ce`.
```bash ```bash
$ sudo dnf update $ sudo dnf update
$ sudo dnf install docker-ce $ sudo dnf install docker-ce
``` ```
使 Docker You can also use the following command to install a certain docker verion you want:
```bash ```bash
$ dnf list docker-ce --showduplicates | sort -r $ dnf list docker-ce --showduplicates | sort -r
@ -90,43 +90,43 @@ docker-ce.x86_64 18.06.1.ce-3.fc28 docker-ce-stable
$ sudo dnf -y install docker-ce-18.06.1.ce $ sudo dnf -y install docker-ce-18.06.1.ce
``` ```
### 使 ### Install with Automatic Scripts
Docker 便Debian 使 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:
```bash ```bash
$ curl -fsSL get.docker.com -o get-docker.sh $ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun $ sudo sh get-docker.sh --mirror Aliyun
``` ```
Docker CE After execution, the script will have everything prepared, and have installed the stable version on your OS.
### Docker CE ### Start Docker CE
```bash ```bash
$ sudo systemctl enable docker $ sudo systemctl enable docker
$ sudo systemctl start 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 ```bash
$ sudo groupadd docker $ sudo groupadd docker
``` ```
`docker` add current user to `docker` group:
```bash ```bash
$ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
``` ```
退 Exit current terminal and relogin to test.
### Docker ### Verify the Installation
```bash ```bash
$ docker run hello-world $ docker run hello-world
@ -159,12 +159,12 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/ https://docs.docker.com/get-started/
``` ```
If it shows the above message, it means your installation is successful.
### ### Registry Mirror(In China)
使 Docker Docker [](mirror.md) If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).
### ### References
* [Docker Fedora ](https://docs.docker.com/install/linux/docker-ce/fedora) * [Docker Official Installation Documents for Fedora](https://docs.docker.com/install/linux/docker-ce/fedora)

View File

@ -1,46 +1,46 @@
## macOS Docker Desktop CE ## Install Docker Desktop CE on maxOS
### ### OS Requirement
[Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/) 要求系统最低为 macOS El Capitan 10.11。 The minimum OS version requirement [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/) is macOS El Capitan 10.11.
### ### Installation
#### 使 Homebrew #### Install with Homebrew
[Homebrew](https://brew.sh/) 的 [Cask](https://caskroom.github.io/) 已经支持 Docker Desktop for Mac因此可以很方便的使用 Homebrew Cask 来进行安装: The [Cask](https://caskroom.github.io/) of [Homebrew](https://brew.sh/) has already supported Docker Desktop for Mac, so we can instrall it with Homebrew Cask easily.
```bash ```bash
$ brew cask install docker $ brew cask install docker
``` ```
#### #### Download and Install Manually
[Stable](https://download.docker.com/mac/stable/Docker.dmg) 或 [Edge](https://download.docker.com/mac/edge/Docker.dmg) 版本的 Docker Desktop for Mac。 If you need to download `Docker Desktop for Mac` manually, please click the [Stable](https://download.docker.com/mac/stable/Docker.dmg) or [Edge](https://download.docker.com/mac/edge/Docker.dmg) link to downlaod it.
macOS `.dmg` [Moby](https://blog.docker.com/2013/10/call-me-moby-dock/) 的鲸鱼图标拖拽到 `Application` 文件夹即可(其间需要输入用户密码)。 Just as other softwares on macOS, the installation of Docker Desktop for macOS is easy. You only need to double click the `.dmg` file, and then drag the whale([Moby](https://blog.docker.com/2013/10/call-me-moby-dock/)) icon to the `Applications` folder. During the process, you will be prompted to enter your password for your mac.
![](_images/install-mac-dmg.png) ![](_images/install-mac-dmg.png)
### ### Run
Docker Find the Docker icon from your applications, and double click the icon to run Docker Desktop.
![](_images/install-mac-apps.png) ![](_images/install-mac-apps.png)
Docker After running, there should be a whale icon on the top right bar of your mac desktop. This icon indicates the running status of Docker.
![](_images/install-mac-menubar.png) ![](_images/install-mac-menubar.png)
"Got it!" For the first time clicking on the icon, you may see the successful installation window. Clicking on "Got it!" will close the window.
![](_images/install-mac-success.png) ![](_images/install-mac-success.png)
Clicking on the whale icon each time afterwards will show you the operation menu.
![](_images/install-mac-menu.png) ![](_images/install-mac-menu.png)
Docker After opening the terminal, you can check the newly-installed Docker version with commands.
```bash ```bash
$ docker --version $ docker --version
@ -51,27 +51,28 @@ $ docker-machine --version
docker-machine version 0.16.1, build cce350d7 docker-machine version 0.16.1, build cce350d7
``` ```
`docker version``docker info` [Nginx ](https://hub.docker.com/_/nginx/) If `docker version` and `docker info` shows no error nor warning, you can try to run an [Nginx Server](https://hub.docker.com/_/nginx/).
```bash ```bash
$ docker run -d -p 80:80 --name webserver nginx $ docker run -d -p 80:80 --name webserver nginx
``` ```
访 <http://localhost>,如果看到了 "Welcome to nginx!",就说明 Docker Desktop for Mac 安装成功了。 When the sever is up and running, you can visit <http://localhost>, if you see "Welcome to nginx!", it means the installation of Docker Desktop for macOS is successful.
![](_images/install-mac-example-nginx.png) ![](_images/install-mac-example-nginx.png)
Nginx To stop the Nginx server and delete it, you can execute the following commands:
```bash ```bash
$ docker stop webserver $ docker stop webserver
$ docker rm webserver $ docker rm webserver
``` ```
### ### Registry Mirror(In China)
使 Docker Docker [](mirror.md) If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).
### ### References
* [](https://docs.docker.com/docker-for-mac/install/) * [Official Document](https://docs.docker.com/docker-for-mac/install/)

View File

@ -1,20 +1,21 @@
## ## Mirror Accelerators
Docker Hub You may have difficulty pulling images from Docker Hub if you are in China. To resolve this issue, you may configure mirror accelerators. There are many cloud service providers that provide accelerators in China, for example,
* [Azure `https://dockerhub.azk8s.cn`](https://github.com/Azure/container-service-for-azure-china/blob/master/aks/README.md#22-container-registry-proxy) * [Azure China Mirrors `https://dockerhub.azk8s.cn`](https://github.com/Azure/container-service-for-azure-china/blob/master/aks/README.md#22-container-registry-proxy)
* [()](https://cr.console.aliyun.com/cn-hangzhou/mirrors) * [Alibaba Cloud Accelerator(Login Required)](https://cr.console.aliyun.com/cn-hangzhou/mirrors)
* [ `https://reg-mirror.qiniu.com`](https://kirk-enterprise.github.io/hub-docs/#/user-guide/mirror) * [Qiniu Cloud Accelerator `https://reg-mirror.qiniu.com`](https://kirk-enterprise.github.io/hub-docs/#/user-guide/mirror)
> > Since some mirror services may be down sometimes, it is recommended to configure multiple mirrors simultaneously.
> Docker Docker > Most of the cloud service giants in China provide Docker image acceleration services, you can choose acceleration services based on which platform you are running Docker on. For more detailed information, you may refer to their official documents.
We take Azure China Mirrors `https://dockerhub.azk8s.cn` as an example to introduce more.
Azure `https://dockerhub.azk8s.cn`
### Ubuntu 16.04+Debian 8+CentOS 7 ### Ubuntu 16.04+Debian 8+CentOS 7
使 [systemd](https://www.freedesktop.org/wiki/Software/systemd/) 的系统,请在 `/etc/docker/daemon.json` 中写入如下内容(如果文件不存在请新建该文件) For Operating Systems using [systemd](https://www.freedesktop.org/wiki/Software/systemd/), please write the following contents inside `/etc/docker/daemon.json`. And if the file does not exist, please create the file.
```json ```json
{ {
@ -24,41 +25,40 @@
] ]
} }
``` ```
> Note, make sure the file is in valid json format, otherwise Docker will be unable to start.
> json Docker Then restart the service.
```bash ```bash
$ sudo systemctl daemon-reload $ sudo systemctl daemon-reload
$ sudo systemctl restart docker $ sudo systemctl restart docker
``` ```
> `docker.service` `--registry-mirror=https://dockerhub.azk8s.cn` > Note: if you refered to the old tutorial previously, and modified the content of `docker.service`, please remove the added contents(`--registry-mirror=https://dockerhub.azk8s.cn`).
### Windows 10 ### Windows 10
使 Windows 10 Docker `Settings` `Daemon` `Registry mirrors` `https://dockerhub.azk8s.cn` `Apply` Docker For windows 10, choose `Settings` in the list after click on the Docker icon at the right-bottom of the desktop. Then choose `Daemon`, and inside the `Registry mirrors`, fill in `https://dockerhub.azk8s.cn`. And finally click `Apply` to save and apply the changes.
### macOS ### macOS
使 macOS Docker Desktop -> Perferences... -> Daemon -> Registry mirrors `https://dockerhub.azk8s.cn` `Apply & Restart` Docker For macOS users, click Docker Desktop icon at the task bar -> Perferences... -> Daemon -> Registry mirrors. Then fill in the accelerator address `https://dockerhub.azk8s.cn` in the list. After the modification, click on `Apply & Restart` button, Docker will restart and apply the new mirror address.
### ### Verify the Accelerator
`$ docker info` After executing `$docker info`, if you can see the following result, you have successfully configured it.
```bash ```bash
Registry Mirrors: Registry Mirrors:
https://dockerhub.azk8s.cn/ https://dockerhub.azk8s.cn/
``` ```
### gcr.io ### gcr.io Mirror
`gcr.io/*` `gcr.io/<repo-name>/<image-name>:<version>` `gcr.azk8s.cn/<repo-name>/<image-name>:<version>` , In China, we cannot fetch `gcr.io/*` mirrors direclty, but we can replace `gcr.io/<repo-name>/<image-name>:<version>` with `gcr.azk8s.cn/<repo-name>/<image-name>:<version>`, for example
```bash ```bash
# $ docker pull gcr.io/google_containers/hyperkube-amd64:v1.9.2 # $ docker pull gcr.io/google_containers/hyperkube-amd64:v1.9.2
$ docker pull gcr.azk8s.cn/google_containers/hyperkube-amd64:v1.9.2 $ docker pull gcr.azk8s.cn/google_containers/hyperkube-amd64:v1.9.2
``` ```

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 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 ```bash
$ sudo apt-get update $ sudo apt-get update
@ -28,19 +29,19 @@ $ sudo apt-get install \
software-properties-common 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 ```bash
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/raspbian/gpg | sudo apt-key add - $ 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 - # $ 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 ```bash
$ sudo add-apt-repository \ $ sudo add-apt-repository \
@ -49,18 +50,18 @@ $ sudo add-apt-repository \
stable" stable"
# # Official Source
# $ sudo add-apt-repository \ # $ sudo add-apt-repository \
# "deb [arch=armhf] https://download.docker.com/linux/raspbian \ # "deb [arch=armhf] https://download.docker.com/linux/raspbian \
# $(lsb_release -cs) \ # $(lsb_release -cs) \
# stable" # 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 ```bash
$ sudo apt-get update $ sudo apt-get update
@ -68,43 +69,43 @@ $ sudo apt-get update
$ sudo apt-get install docker-ce $ 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 ```bash
$ curl -fsSL get.docker.com -o get-docker.sh $ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun $ 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 ```bash
$ sudo systemctl enable docker $ sudo systemctl enable docker
$ sudo systemctl start 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 ```bash
$ sudo groupadd docker $ sudo groupadd docker
``` ```
`docker` add current user to `docker` group:
```bash ```bash
$ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
``` ```
退 Exit current terminal and relogin to test.
### Docker ### Verify the Installation
```bash ```bash
$ docker run arm32v7/hello-world $ docker run arm32v7/hello-world
@ -137,10 +138,10 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/ 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).

View File

@ -1,12 +1,12 @@
## Install Docker CE on Ubuntu ## Install Docker CE on Ubuntu
>warning: Don't install Docker CE directly using apt without configuring Docker APT source. > warning: Don't install Docker CE directly using apt without configuring Docker APT source.
### Preparation ### Prerequisites
#### System requirements #### System requirements
Docker CE supports [Ubuntu](https://www.ubuntu.com/server) versions: Docker CE supported [Ubuntu](https://www.ubuntu.com/server) versions:
* Disco 19.04 * Disco 19.04
* Cosmic 18.10 * Cosmic 18.10
@ -39,7 +39,7 @@ $ sudo apt-get install \
software-properties-common software-properties-common
``` ```
If you are in China, it is strongly recommended to use chinese sources. The official sources are in the comments. If you are in China, it is strongly recommended to use Chinese sources. The official sources are in the comments.
In order to confirm the validity of the downloaded package, we need to add the `GPG` key of the software source. In order to confirm the validity of the downloaded package, we need to add the `GPG` key of the software source.
@ -67,7 +67,7 @@ $ sudo add-apt-repository \
# stable" # stable"
``` ```
>The above commands will add stable Docker CE APT source. If you need test or nightly version of Docker, you can change the stable to test or nightly. > The above commands will add stable Docker CE APT source. If you need the `test` or `nightly` version of Docker, you can change `stable` to `test` or `nightly`.
#### Install Docker CE #### Install Docker CE
@ -81,14 +81,14 @@ $ sudo apt-get install docker-ce
### Auto install by script ### Auto install by script
Docker Offical has provided a set of convenient install scripts which can be installed on Ubuntu system for test or dev environments. Docker Offical has provided a set of convenient installation scripts which can be installed on Ubuntu for test or dev environments.
```bash ```bash
$ curl -fsSL get.docker.com -o get-docker.sh $ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun $ sudo sh get-docker.sh --mirror Aliyun
``` ```
Script will make everythings ok and install Edge version of Docker CE for system after this command. The script will have everything prepared and have installed the stable version of Docker CE for the system after execution.
### Launcher Docker CE ### Launcher Docker CE
@ -97,9 +97,9 @@ $ sudo systemctl enable docker
$ sudo systemctl start docker $ sudo systemctl start docker
``` ```
### Add docker user group ### Add Docker Usergroups
Command `docker` uses [Unix socket](https://en.wikipedia.org/wiki/Unix_domain_socket) to communicate with Docker engine default. Only users of `root` and `docker` groups can communicate Unix socket of 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. 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.
create `docker` group: create `docker` group:
@ -115,7 +115,7 @@ $ sudo usermod -aG docker $USER
Exit current terminal and relogin to test. Exit current terminal and relogin to test.
### Test whether Docker is installed correctly ### Verify the Installation
```bash ```bash
$ docker run hello-world $ docker run hello-world
@ -148,12 +148,12 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/ https://docs.docker.com/get-started/
``` ```
If it shows above message, it means successful installation. If it shows above the message, it means your installation is successful.
### Registry Mirror(In China) ### Registry Mirror(In China)
If you pull docker images very slowly, then you can configurate [Registry Mirror](mirror.md). If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).
### Links ### References
* [Offical Docker Docs](https://docs.docker.com/install/linux/docker-ce/ubuntu/) * [Docker Official Installation Documents for Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/)

View File

@ -2,15 +2,15 @@
### System requirements ### System requirements
[Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/) needs Windows 10 Pro 64 bit and activates Hyper-V [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/) requires Windows 10 Pro 64-bit that activates [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/).
### Install ### Install
Download Docker Desktop for Windows [Stable](https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe) or [Edge](https://download.docker.com/win/edge/Docker%20Desktop%20Installer.exe), then double-click Docker for `Docker Desktop Installer.exe` to install. Download Docker Desktop for Windows [Stable](https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe) or [Edge](https://download.docker.com/win/edge/Docker%20Desktop%20Installer.exe), then double-click `Docker Desktop Installer.exe` to install.
### Running ### Running
Search Docker in Windows and click Docker for Windows to run. Search Docker in Windows and click `Docker for Windows` to run.
![](_images/install-win-docker-app-search.png) ![](_images/install-win-docker-app-search.png)
@ -18,14 +18,14 @@ There is a whale icon in the Windows taskbar after running Docker CE.
![](_images/install-win-taskbar-circle.png) ![](_images/install-win-taskbar-circle.png)
Wait a moment and click Got it to start using Docker CE. Wait a moment and click "Got it" to start using Docker CE.
![](_images/install-win-success-popup-cloud.png) ![](_images/install-win-success-popup-cloud.png)
### Registry Mirror(In China) ### Registry Mirror(In China)
If you pull docker images very slowly, then you can configurate [Registry Mirror](mirror.md). If you pull docker images very slowly, then you can configure [Registry Mirror](mirror.md).
### Links ### Links
* [Docs](https://docs.docker.com/docker-for-windows/install/) * [Docker Offical Docs](https://docs.docker.com/docker-for-windows/install/)