Mac安裝dockertoolbox和啓動dockerdocker
➜ ~shell
docker version
Client:bash
Version: 1.8.1tcp
API version: 1.20ui
Go version: go1.4.2unix
Git commit: d12ea79code
Built: Thu Aug 13 02:49:29 UTC 2015server
OS/Arch: darwin/amd64ip
Get http:///var/run/docker.sock/v1.20/version: dial unix /var/run/docker.sock: no such file or directory.get
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
須要安裝vm
而後再啓動,仍是報錯:
Machine default already exists in VirtualBox.
Starting machine default...
Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Setting environment variables for machine default...
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
open /Users/ylchou/.docker/machine/machines/default/ca.pem: no such file or directory
bash-3.2$
經過
find / -name ca.pem
能夠看到在目錄下有ca.pem
/Users/ylchou/.docker/machine/certs/ca.pem
拷貝到/Users/ylchou/.docker/machine/machines/default/目錄下
cp /Users/ylchou/.docker/machine/certs/ca.pem /Users/ylchou/.docker/machine/machines/default
再次啓動,報錯:
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
open /Users/ylchou/.docker/machine/machines/default/server.pem: no such file or directory
竟然能夠ping通192.168.99.100
➜ default
ping 192.168.99.100
PING 192.168.99.100 (192.168.99.100): 56 data bytes
64 bytes from 192.168.99.100: icmp_seq=0 ttl=64 time=0.409 ms
64 bytes from 192.168.99.100: icmp_seq=1 ttl=64 time=0.504 ms
64 bytes from 192.168.99.100: icmp_seq=2 ttl=64 time=0.242 ms
64 bytes from 192.168.99.100: icmp_seq=3 ttl=64 time=0.994 ms
^C
--- 192.168.99.100 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.242/0.537/0.994/0.280 ms
bash -c "clear && DOCKER_HOST=tcp://192.168.99.100:2376 DOCKER_CERT_PATH=/Users/ylchou/.docker/machine/machines/default DOCKER_TLS_VERIFY=1 /bin/zsh"
bash -c "clear && DOCKER_HOST=tcp://192.168.99.100:2376 DOCKER_CERT_PATH=/Users/ylchou/.docker/machine/machines/default DOCKER_TLS_VERIFY=1 docker exec -it busybox_hehe sh"