docker使用起来真是简单,只需要简单的几步,一个程序就能跑起来。
第一步,从docker官网上下载DockerToolbox-1.8.1c.pkg到本地,然后一路next就把程序装好。(后台会给你装好几个程序, 如virtualBox虚拟机,docker部署工具docker machine等。
第二步, 如下,找到docker terminal,打开,就进入来docker的控制台:
第三步, 输入命令 docker run hello-world,docker会自动从docker hub上把程序下载下来,然后运行起来,最后输出结果。最后docker还会解释下这个过程中进行了那几步。
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.
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 Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/
总结:
docker运行部署程序真是太简单了,simple is the best!