docker(二):Mac docker hello-world
2017-05-18 14:31
330 查看
终端按顺序执行如下命令:
保证虚拟机电源开启
出现如下信息:
**
WARNING: The ‘boot2docker’ command line interface (not to be confused with
‘boot2docker’ the operating system) is officially deprecated.
Please switch to Docker Machine (https://docs.docker.com/machine/) ASAP.
Docker Toolbox (https://docker.com/toolbox) is the recommended install method.
Waiting for VM and Docker daemon to start…
Writing /Users/jinx/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/jinx/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/jinx/.boot2docker/certs/boot2docker-vm/key.pem
To connect the Docker client to the Docker daemon, please set:
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/jinx/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
Or run:
**
docker默认账户密码为:tcuser
显示如下:
**
docker@localhost’s password:
docker@localhost’s password:
docker@localhost’s password:
Writing /var/root/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /var/root/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /var/root/.boot2docker/certs/boot2docker-vm/key.pem
**
出现以下画面:
**
**
显示如下:
**
Command “daemon” is deprecated, and will be removed in Docker 17.12. Please run
chmod /var/lib/docker: operation not permitted
docker@boot2docker:~$ docker run hello-world
Unable to find image ‘hello-world:latest’ locally
**
结果如下:
**
Unable to find image ‘hello-world:latest’ locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
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/
**
su root//切换为root账户
sudo env//下面使用root进行操作
boot2docker init//初始化虚拟机,包括虚拟机镜像下载
保证虚拟机电源开启
boot2docker up//把虚拟机打开
出现如下信息:
**
WARNING: The ‘boot2docker’ command line interface (not to be confused with
‘boot2docker’ the operating system) is officially deprecated.
Please switch to Docker Machine (https://docs.docker.com/machine/) ASAP.
Docker Toolbox (https://docker.com/toolbox) is the recommended install method.
Waiting for VM and Docker daemon to start…
Writing /Users/jinx/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/jinx/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/jinx/.boot2docker/certs/boot2docker-vm/key.pem
To connect the Docker client to the Docker daemon, please set:
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/jinx/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
Or run:
eval "$(boot2docker shellinit)"
**
docker默认账户密码为:tcuser
eval "$(boot2docker shellinit)"//添加环境变量可能要输入密码tcuser
显示如下:
**
docker@localhost’s password:
docker@localhost’s password:
docker@localhost’s password:
Writing /var/root/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /var/root/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /var/root/.boot2docker/certs/boot2docker-vm/key.pem
**
boot2docker ssh
出现以下画面:
**
**
docker daemon
显示如下:
**
Command “daemon” is deprecated, and will be removed in Docker 17.12. Please run
dockerddirectly.
chmod /var/lib/docker: operation not permitted
docker@boot2docker:~$ docker run hello-world
Unable to find image ‘hello-world:latest’ locally
**
docker run hello-world//运行hello-world
结果如下:
**
Unable to find image ‘hello-world:latest’ locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
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/
**
相关文章推荐
- 打包一个Docker镜像,让你的好友加载开启一个容器,并且每隔一秒输出hello,world到指定的文件中
- hello world to php( mac 配置 xmapp virtual host)
- docker run hello-world的工作流程
- hello world unbuntu下安装docker
- React Native HelloWorld for mac
- 联发科Linkit 7688 (一) 上手及在Mac下搭建OpenWrt交叉编译环境,C语言编译Hello,World
- Docker Hello World
- Docker Hello World
- 教程:使用 Xcode 编写 Mac OS X 下的"Hello, World!"
- mac erlang hello world
- Docker Hello World
- Mac上用 Terminal编写Hello,world
- Docker入门学习(2)----Docker安装和第一个hello-world
- hello world on mac
- hello world to php( mac 配置 xmapp virtual host)
- 第一次安装Docker并运行hello-world
- docker_hello_world实现遇到的坑
- mac终端下c++编写的Hello_World
- 最小 Docker 镜像 hello-world 剖析