Docker 企业版(EE)专为企业开发和 IT 团队设计,可在大规模生产中构建,运送和运行关键业务应用程序。Docker EE 集成,认证和支持,为企业提供业界最安全的容器平台,实现所有应用程序的现代化。作为一个以应用为中心的平台,Docker EE 旨在加速和保护整个软件供应链,从开发到在任何基础设施上运行的生产。
我们学习 Docker 使用 CE 社区版即可。
基于 CentOS 安装 Docker 引擎
Docker 支持 Mac Windows Linux,本文使用 Linux 环境教大家如何基于 CentOS 安装 Docker 及配置镜像加速。
[root@localhost ~]# docker -vDocker version 19.03.12, build 48a66213fe
[root@localhost ~]# docker versionClient: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:46:54 2020 OS/Arch: linux/amd64
Experimental: falseServer: Docker Engine - Community
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12) Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:45:28 2020 OS/Arch: linux/amd64
Experimental: false containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
配置镜像加速
Docker 从 Docker Hub 拉取镜像,因为是从国外获取,所以速度较慢,会出现以下情况:
1
2
3
4
[root@localhost ~]# docker run hello-worldUnable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: net/http: TLS handshake timeout.
See 'docker run --help'.
[root@localhost ~]# docker run hello-worldUnable to find image 'hello-world:latest' locally # 本地找不到 hello-world 镜像latest: Pulling from library/hello-world # 拉取最新版本的 hello-world 镜像0e03bdcc26d7: Pull completeDigest: sha256:49a1c8800c94df04e9658809b006fd8a686cab8028d33cfba2cc049724254202
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://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/