osx - How to run docker on mac offline -
when installed docker on mac, took ip intranet network. there after when switched different network showing me error
$ bash --login '/applications/docker/docker quickstart terminal.app/contents/resources/scripts/start.sh' starting "default"... (default) waiting ip... many retries waiting ssh available. last error: maximum number of retries (60) exceeded regenerate tls machine certs? warning: irreversible. (y/n): regenerating tls certificates detecting provisioner... error getting ssh command: went wrong running ssh command! command : cat /etc/os-release err : exit status 255 output : error checking tls connection: went wrong running ssh command! command : ip addr show dev eth1 err : exit status 255 output : ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ error getting ip address: went wrong running ssh command! command : ip addr show dev eth1 err : exit status 255 output : docker configured use default machine ip getting started, check out docs @ https://docs.docker.com
i understood related gateway got configured in 'default' ran
docker-machine rm default (this deleted downloaded images) docker-machine create --driver virtualbox default
went offline , relaunched docker-machine default got built. after went online , tried download image. getting connection errors.
$ docker run -t -i --name myfirstcontainer ubuntu:14.04 /bin/bash unable find image 'ubuntu:14.04' locally pulling repository docker.io/library/ubuntu network timed out while trying connect https://index.docker.io/v1/repositories/library/ubuntu/images. may want check internet connection or if behind proxy.
i think because when offline , no interface assigned 'default'
$ docker network inspect bridge [ { "name": "bridge", "id": "df562e1cae477be7d2dc09a30ee21b0871a2202731506d3f6db3df9c1abb4cad", "scope": "local", "driver": "bridge", "ipam": { "driver": "default", "config": [ { "subnet": "172.17.0.0/16" } ] }, "containers": {}, "options": { "com.docker.network.bridge.default_bridge": "true", "com.docker.network.bridge.enable_icc": "true", "com.docker.network.bridge.enable_ip_masquerade": "true", "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "1500" } } ]
state when reconnected network , rebuilt 'default'
$ docker-machine create --driver virtualbox default running pre-create checks... (default) default boot2docker iso out-of-date, downloading latest release... (default) latest release github.com/boot2docker/boot2docker v1.10.0 (default) downloading /users/tt/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v1.10.0/boot2docker.iso... (default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100% creating machine... (default) copying /users/tt/.docker/machine/cache/boot2docker.iso /users/tt/.docker/machine/machines/default/boot2docker.iso... (default) creating virtualbox vm... (default) creating ssh key... (default) starting vm... (default) waiting ip... waiting machine running, may take few minutes... machine running, waiting ssh available... detecting operating system of created instance... detecting provisioner... provisioning boot2docker... copying certs local machine directory... copying certs remote machine... setting docker configuration on remote daemon... machine has been allocated ip address, docker machine not reach successfully. ssh machine should still work, connecting exposed ports, such docker daemon port (usually <ip>:2376), may not work properly. may need add route manually, or use related workaround. due vpn, proxy, or host file configuration issue. might want clear virtualbox host interfaces not using. checking connection docker... docker , running! see how connect docker machine, run: docker-machine env default $ docker network inspect bridge [ { "name": "bridge", "id": "307267097a1845e6ac7b2a6a67bf800b8cda05f036c649a92af59a44689a55ab", "scope": "local", "driver": "bridge", "ipam": { "driver": "default", "config": [ { "subnet": "172.17.0.0/16" } ] }, "containers": {}, "options": { "com.docker.network.bridge.default_bridge": "true", "com.docker.network.bridge.enable_icc": "true", "com.docker.network.bridge.enable_ip_masquerade": "true", "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "1500" } } ] $ docker run -t -i --name myfirstcontainer ubuntu:14.04 /bin/bash unable find image 'ubuntu:14.04' locally 14.04: pulling library/ubuntu 8387d9ff0016: pull complete 3b52deaaf0ed: pull complete 4bd501fad6de: pull complete a3ed95caeb02: pull complete digest: sha256:0844055d30c0cad5ac58097597a94640b0102f47d6fa972c94b7c129d87a44b7 status: downloaded newer image ubuntu:14.04
is there anyway can seamlessly run docker when switching networks or when offline?
Comments
Post a Comment