百度百科:Docker 是一個開源的應用容器引擎,讓開發(fā)者可以打包他們的應用以及依賴包到一個可移植的容器中忿磅,然后發(fā)布到任何流行的Linux機器上罐农,也可以實現(xiàn)虛擬化汗侵。容器是完全使用沙箱機制崔拥,相互之間不會有任何接口极舔。
優(yōu)勢: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啟動后狀態(tài)變?yōu)榫G色
2.啟動后執(zhí)行
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圖形化管理工具
安裝完畢,繼續(xù)按照官網文檔步驟前進
~