I'm trying to use Docker Machine to connect to a Docker VirtualBox VM on a different host. At my local host, the setup is successful, including examples installing Busybox and echo a 'hello world' from a VM called 'dev', like this:
$ docker $(docker-machine config dev) run busybox echo hello world
I can create as many comparable local Docker VirtualBox VMs I like with Docker Machine and the result is similar succesful.
Now I would like to do the same using my local Docker Machine and execute docker commands on a different physical host where I installed Docker Machine and Boot2Docker as well. In other words: I would like to use my local Docker Machine CLI and remotely command to e.g. pull an image and run a container on that different host. Is that possible, and if so, how?
I just tested with dind (Docker-in-Docker) here is the link So all you have to do is run this in your host: Docker Host IP: 172.17.42.1
you can create another node by
docker -H tcp://DOCKER_HOST:1235 run -d swarm join --addr=DOCKER_HOST:1235 token://cluster_id
docker run -d -p 2375:2375 swarm manage token://cluster_id
Check is everything OK docker -H tcp://DOCKER_HOST:2375 info
If you see 2 container, you are successfully created swarm cluster and docker machines as docker container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With