您的位置:首页 > 运维架构 > Docker

docker学习笔记-1

2016-05-26 21:40 639 查看

docker学习笔记一:安装

mac安装docker

docker官方文档上有这么一段话:


Because the Docker daemon uses Linux-specific kernel features, you can’t run Docker natively in OS X. Instead, you must use docker-machine to create and attach to a virtual machine (VM). This machine is a Linux VM that hosts Docker for you on your Mac


由于docker使用了特定的Linux内核功能,因此不能用原生的方式在os x上运行docker,只能使用docker-machine去创建docker并将它绑定到linux虚拟机上。

注意:只能在OS X 10.8以上的版本的mac上安装docker。

安装步骤

如果你有VirtualBox正在运行,需要首先关闭正在运行的VirtualBox。

下载页面下载docker toolbox。

下载完毕,执行安装,安装完毕如下图:



执行最简单一个docker命令

docker run hello-word // 这个命令会从dockerhub下载hello-world镜像




执行上图的中建议的命令

docker run -it ubuntu bash // 会在本地安装ubuntu的镜像

通过docker images 命令可以查看到刚才下载到本地的镜像



问题

执行命令:

sudo docker commit -m "add nginx from ubuntu" -a "hwy1782" 60fff3da025c hwy1782/ubuntu-nginx:v1
报如下错误:
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

github上有相关的issue:

https://github.com/docker/kitematic/issues/1010

参考文献

Docker简明教程

Docker via Homebrew

Mac OS X
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: