Merge pull request #421 from 00Kai0/english

update ubuntu.md
pull/422/head
Kang Huaishuai 2019-09-06 16:39:39 +08:00 committed by GitHub
commit a7d3a8291f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 33 deletions

View File

@ -1,23 +1,23 @@
## Ubuntu Docker CE
## Install Docker CE on Ubuntu
> Docker APT 使 apt Docker.
>warning: Don't install Docker CE directly using apt without configuring Docker APT source.
###
### Preparation
####
#### System requirements
Docker CE [Ubuntu](https://www.ubuntu.com/server) 操作系统:
Docker CE supports [Ubuntu](https://www.ubuntu.com/server) versions:
* Disco 19.04
* Cosmic 18.10
* Bionic 18.04 (LTS)
* Xenial 16.04 (LTS)
Docker CE 64 x86 ARM Ubuntu LTSLong-Term-Support 5 使 LTS
Docker CE can be installed on x86 platform or ARM. In Ubuntu distributions, LTS (Long-Term-Support) will get 5 years updating support, distributions like this will be stable. Therefore, LTS version is recommended in production environment.
####
#### Uninstall old version
Docker `docker` `docker-engine`使
Old version of Docker is called `docker` or `docker-engine`. Use the following command to uninstall the old version:
```bash
$ sudo apt-get remove docker \
@ -25,9 +25,9 @@ $ sudo apt-get remove docker \
docker.io
```
### 使 APT
### Use APT to install
`apt` 使 HTTPS 使 HTTPS CA
Because the `apt` source uses HTTPS to ensure that software downloads are not tampered with. Therefore, we need to add software packages and CA certificates that are transmitted using HTTPS first.
```bash
$ sudo apt-get update
@ -39,19 +39,19 @@ $ sudo apt-get install \
software-properties-common
```
使
If you are in China, it is strongly recommended to use chinese sources. The official sources are in the comments.
`GPG`
In order to confirm the validity of the downloaded package, we need to add the `GPG` key of the software source.
```bash
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
#
# official
# $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
`source.list` Docker
Then, we need to add Docker software source to `source.list`
```bash
$ sudo add-apt-repository \
@ -60,18 +60,18 @@ $ sudo add-apt-repository \
stable"
#
# official
# $ sudo add-apt-repository \
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) \
# stable"
```
> Docker CE APT Docker CE stable test nightly
>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.
#### Docker CE
#### Install Docker CE
apt `docker-ce`
Update apt cache and install `docker-ce`:
```bash
$ sudo apt-get update
@ -79,43 +79,43 @@ $ sudo apt-get update
$ sudo apt-get install docker-ce
```
### 使
### Auto install by script
Docker 便Ubuntu 使
Docker Offical has provided a set of convenient install scripts which can be installed on Ubuntu system for test or dev environments.
```bash
$ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh --mirror Aliyun
```
Docker CE Edge
Script will make everythings ok and install Edge version of Docker CE for system after this command.
### Docker CE
### Launcher Docker CE
```bash
$ sudo systemctl enable docker
$ sudo systemctl start docker
```
### docker
### Add docker user group
`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 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.
`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
### Test whether Docker is installed correctly
```bash
$ docker run hello-world
@ -148,12 +148,12 @@ For more examples and ideas, visit:
https://docs.docker.com/get-started/
```
If it shows above message, it means successful installation.
###
### Registry Mirror(In China)
使 Docker Docker [](mirror.md)
If you pull docker images very slowly, then you can configurate [Registry Mirror](mirror.md).
###
### Links
* [Docker Ubuntu ](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
* [Offical Docker Docs](https://docs.docker.com/install/linux/docker-ce/ubuntu/)