# docker pull hello-worldUsing default tag: latestlatest: Pulling from library/hello-world0e03bdcc26d7: Pull complete Digest: sha256:8c5aeeb6a5f3ba4883347d3747a7249f491766ca1caa47e5da5dfcf6b9b717c0Status: Downloaded newer image for hello-world:latestdocker.io/library/hello-world:latest
启动 hello-world:docker run hello-world
# docker run hello-worldHello 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 theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:http://hub.docker.com/For more examples and ideas, visit:http://docs.docker.com/get-started/到目前为止,已经有一个Docker容器hello-world就运行起来了。本文我们不具体讲Docker实操,只是简单体验一下Docker的温度。实操部分可以去看官网,或者等我下一篇文章的更新。
Docker采用的是常见的client-server模式。Client端负责接受用户输入的命令,像我们前面提到的docker pull、run等。真正执行命令的是Server端,也就是docker的守护线程daemon。client和daemon之间通过rest api进行通信,它们可以在同一台机器也可以在不同机器。类比mysql的client和server。
[attach]54994[/attach]Docker架构
除了client和server,我们还看到Registry,它是储存Docker镜像的地方,类比maven的仓库。Docker Hub是官方提供的中央仓库,当然可以创建自己的私库。
这里我们有必要理解几个概念