mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-11 09:23:43 +00:00
Update install content AND Add raspberry-pi
This commit is contained in:
@@ -10,9 +10,6 @@ Docker CE 支持以下版本的 [Debian](https://www.debian.org/intro/about) 操
|
||||
* Jessie 8 (LTS)
|
||||
* Wheezy 7.7 (LTS)
|
||||
|
||||
Docker CE 可以安装在 64 位的 x86 平台或 ARM 平台上(如[树莓派](https://www.raspberrypi.org/))。
|
||||
|
||||
|
||||
#### 卸载旧版本
|
||||
|
||||
旧版本的 Docker 称为 `docker` 或者 `docker-engine`,使用以下命令卸载旧版本:
|
||||
@@ -120,19 +117,6 @@ $ sudo sh get-docker.sh --mirror Aliyun
|
||||
|
||||
执行这个命令后,脚本就会自动的将一切准备工作做好,并且把 Docker CE 的 edge 版本安装在系统中。
|
||||
|
||||
### 树莓派安装 Docker CE
|
||||
|
||||
基本和上述步骤相同,添加 apt 源时请使用如下命令:
|
||||
|
||||
```bash
|
||||
$ sudo add-apt-repository \
|
||||
"deb [arch=armhf] https://mirrors.ustc.edu.cn/docker-ce/linux/raspbian \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
```
|
||||
|
||||
ARM 平台不能使用 x86 镜像,查看树莓派可使用镜像请访问 [arm32v7](https://hub.docker.com/u/arm32v7/)。
|
||||
|
||||
### 启动 Docker CE
|
||||
|
||||
```bash
|
||||
@@ -162,6 +146,41 @@ $ sudo groupadd docker
|
||||
$ sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
### 测试 Docker 是否安装正确
|
||||
|
||||
```bash
|
||||
$ docker run hello-world
|
||||
|
||||
Unable to find image 'hello-world:latest' locally
|
||||
latest: Pulling from library/hello-world
|
||||
ca4f61b1923c: Pull complete
|
||||
Digest: sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
|
||||
Status: Downloaded newer image for hello-world:latest
|
||||
|
||||
Hello from Docker!
|
||||
This message shows that your installation appears to be working correctly.
|
||||
|
||||
To generate this message, Docker took the following steps:
|
||||
1. The Docker client contacted the Docker daemon.
|
||||
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||
(amd64)
|
||||
3. The Docker daemon created a new container from that image which runs the
|
||||
executable that produces the output you are currently reading.
|
||||
4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||
to your terminal.
|
||||
|
||||
To try something more ambitious, you can run an Ubuntu container with:
|
||||
$ docker run -it ubuntu bash
|
||||
|
||||
Share images, automate workflows, and more with a free Docker ID:
|
||||
https://cloud.docker.com/
|
||||
|
||||
For more examples and ideas, visit:
|
||||
https://docs.docker.com/engine/userguide/
|
||||
```
|
||||
|
||||
若能正常输出以上信息,则说明安装成功。
|
||||
|
||||
### 镜像加速
|
||||
|
||||
鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,强烈建议安装 Docker 之后配置 [国内镜像加速](mirror.md)。
|
||||
@@ -169,4 +188,3 @@ $ sudo usermod -aG docker $USER
|
||||
### 参考文档
|
||||
|
||||
* [Docker 官方 Debian 安装文档](https://docs.docker.com/engine/installation/linux/docker-ce/debian/)
|
||||
* [阿里云 Docker CE 安装镜像帮助](https://yq.aliyun.com/articles/110806)
|
||||
|
Reference in New Issue
Block a user