1.docker简介
2017-11-07 本文已影响0人
元代码
百度百科:Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。
优势:Docker技术可以以一种简单的方式,在服务压力增大时,快速加入软、硬件分担服务压力。
1.官网
文档
https://docs.docker.com/get-started/#setup
下载地址
https://docs.docker.com/engine/installation/
mac版下载连接
https://download.docker.com/mac/stable/Docker.dmg
例子
https://docs.docker.com/samples/#tutorial-labs
下载并安装后运行docker 等docker启动后状态变为绿色
2.启动后执行
docker run hello-world
控制台输出:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
5b0f327be733: Pull complete
Digest: sha256:07d5f7800dfe37b8c2196c7b1c524c33808ce2e0f74e7aa00e603295ca9a0972
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.
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/
3.查看版本
docker --version
控制台输出:
Docker version 17.09.0-ce, build afdb6d4
4.安装docker toolbox,使用swarm时会用到
https://docs.docker.com/toolbox/overview/
docker toolbox还集成了kitematic,Dokcer图形化管理工具
安装完毕,继续按照官网文档步骤前进
~