Cristian Garcia
Cristian Garcia

Reputation: 9859

docker-machine breaks docker native client on linux

I am on Ubuntu and decided to use docker-machine to run some docker swarm tests. Here you execute

eval $(docker-machine env xxxxx)

and with that your native docker client points to that machine/vm. However, after the tests I wan't the docker command to point to my local docker client/daemon/whatever and executed

eval $(docker-machine env -u)

which is supposed to unset the environment variables. But now I get this error

docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?. See 'docker run --help'.

I've had to create a docker machine on VirtualBox called default, point to that machine and run my commands there. But its pretty lame since I feel like I am back on Windows and one of the reason I came to Ubuntu was better docker integration.

Is there any fix for this?

Upvotes: 0

Views: 92

Answers (1)

buildmaestro
buildmaestro

Reputation: 1446

unset all docker variables

  unset ${!DOCKER_*}    

regarding the 'can't connect to daemon', ensure you're prepending each docker command with sudo, or to allow your current user to interact with docker use:

  sudo groupadd docker
  sudo usermod -aG docker $(whoami)

restart docker and re-login to the terminal

Upvotes: 2

Related Questions