新手玩Docker
2015-06-16 00:21
633 查看
参考资料chenhengjie123 ,感谢@chenhengjie123分享
docker
boot2docker
VirtualBox
docker和boot2docker可以通过命令行安装,也可以通过安装包安装,但是别忘了VirtualBox VM的安装哦,安装后就是小面的小图标:
我们打开VirtualBox:
左边栏是空的,好了,现在我们使用boot2docker来创建docker客户端所需的虚拟机,看动画:
启动完成后就是这么一个鬼
我们动画中演示的是从VirturalBox中双击启动Docker 客户端,也可以在外部通过
跑个官方提供的hello-world镜像:
docker run <镜像名>
环境
实验所用的是os x系统,所以需要通过boot2docker来引导,然后需要VirtualBox VM启动docker,所以可想而知我们的环境需要3个组件:docker
boot2docker
VirtualBox
docker和boot2docker可以通过命令行安装,也可以通过安装包安装,但是别忘了VirtualBox VM的安装哦,安装后就是小面的小图标:
启动Docker
boot2docker init创建Docker虚拟机
我们打开VirtualBox:
左边栏是空的,好了,现在我们使用boot2docker来创建docker客户端所需的虚拟机,看动画:
启动完成后就是这么一个鬼
我们动画中演示的是从VirturalBox中双击启动Docker 客户端,也可以在外部通过
boot2docker start启动.这样启动后,完全是看不到VirturalBox里的内容也看不到海豚的图像.
Hello World
要想在外部连接Docker 客户端,需要先设置环境变量,通过下面命令执行:eval '$(boot2docker shellinit)'
跑个官方提供的hello-world镜像:
docker run <镜像名>
localhost:~ wuxian$ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from hello-world a8219747be10: Pull complete 91c95931e552: Already exists hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d 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. (Assuming it was not already locally available.) 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 For more examples and ideas, visit: http://docs.docker.com/userguide/
相关文章推荐
- Install Docker on Mac OS X(转)
- 十分钟写一个简单的docker
- Docker
- 有人说Docker Hub上三成的镜像包含漏洞?是吗?
- docker基本操作
- 安装docker-registry
- 两款Docker管理UI:DockerUI & Shipyard
- 剖析Docker文件系统:Aufs与Devicemapper
- docker + ambari(hortonworks ) 快速搭建hadoop 环境
- docker常用技巧汇总
- ubuntu14.04创建含ssh服务的suse11sp2 docker容器
- Docker入门实战
- docker
- 【PlaceHolder】Docker Inital Investigation and Ramp up
- Docker原理 -- namespace与CGroup
- Docker的安全基准
- Docker Nova Driver实践
- Docker的安装使用-第1章
- Docker学习
- 浅谈Docker隔离性和安全性