Brian FitzGerald
Brian FitzGerald

Reputation: 3109

running docker commands on host

I have my docker-machine running, and from my HOST (Macbook) I can run things like docker-machine ssh or docker-machine ls and see the expected results.

However, from my host machine, I can NOT run "docker engine" commands, such as docker ps, etc. In order to run those commands I need to ssh into my docker-machine and run them there, does that sound correct, or do I have something setup incorrectly?

It seems like it might be ok, but then again some of the tutorials I am reading have led me to believe that running docker commands on the host (as long as they are run within the /Users directory would automatically be run on the docker-machine vm. Thoughts?

Upvotes: 0

Views: 100

Answers (1)

jwodder
jwodder

Reputation: 57470

In order to run docker commands on your host, you need to set the necessary environment variables to tell your host Docker client where the Docker daemon is located (which is inside the Docker Machine). These environment variables are output by docker-machine env NAME_OF_MACHINE, and then you just need to eval them: eval "$(docker-machine env NAME_OF_MACHINE)"

Upvotes: 2

Related Questions