Docker Community Forums

Share and learn in the Docker community.

Not able to configure docker-machine shell to swarm manager


(Manojmathewcm) #1

I’m just starting with Dockers and I’m trying out the steps under Get Started section in the docs.

I’m using an Ubuntu machine.
Docker version: 17.09.0-ce
Docker machine version: 0.13.0

I’m trying “Configure a docker-machine shell to the swarm manager” in the above link.

After setting the environment variables using - eval $(docker-machine env myvm1)

sudo docker-machine env myvm1
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST=“tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH=”/home/mancm/.docker/machine/machines/myvm1"
export DOCKER_MACHINE_NAME=“myvm1”
# Run this command to configure your shell:
# eval $(docker-machine env myvm1)

eval $(sudo docker-machine env myvm1)

env | grep DOCKER
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_MACHINE_NAME=myvm1
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/home/mancm/.docker/machine/machines/myvm1

I still done see that myvm1 is active.

sudo docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
myvm1 - virtualbox Running tcp://192.168.99.100:2376 v17.09.0-ce
myvm2 - virtualbox Running tcp://192.168.99.101:2376 v17.09.0-ce

What can I check to find why this doesn’t work ?


(Manojmathewcm) #3

I removed the machines and created again. The below messages are seen during creation:

"
This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually :2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
Checking connection to Docker…
"

Could this be the reason ?
How can this be resolved ?


(Manojmathewcm) #4

I was able to create VM without the error “This machine has been allocated an IP address, but Docker Machine could not reach it successfully” after removing the host only interface using the below command:

“VBoxManage hostonlyif remove vboxnet0”

Even after this setting the ENV variables do not let me connect directly to the created docker-machine.

sudo docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
myvm1 - virtualbox Running tcp://192.168.99.100:2376 v17.09.0-ce
myvm2 - virtualbox Running tcp://192.168.99.101:2376 v17.09.0-ce