Docker Community Forums

Share and learn in the Docker community.

DOCKER_HOST env variable uses and documentation

docker

(Dockervick) #1

Hi,

I see DOCKER_HOST as an environment variable comes across in several discussions. I’m using CentOS Linux release 7.2.1511 (Core) to run my containers version 1.10.3. I am not able to find any documentation on DOCKER_HOST variables where it is to be used and why it is used . I’m able to use my containers without setting it but I’m pretty sure that I might have to use it sometime. I understand that it is currently mandatory for Mac OS.

Could someone please provide some information or point me to some information on it,

Thanks,


(David Maze) #2

You never need to set it in normal use. If you’re using Docker Machine to run Docker in a local VM, the docker-machine env command will set it.

The environment variable is briefly mentioned in https://docs.docker.com/engine/reference/commandline/cli/. If it’s not set, it defaults to a local socket, with the precise path varying by platform.

With the exception of the local Docker Machine setup, configurations where it’s even possible to set $DOCKER_HOST to something else are dangerously insecure. Remember that being able to reach the Docker socket is equivalent to unrestricted root-level access over that system.


(Dockervick) #3

Okay. Thanks for the info.

Yes I went through the link earlier but that was not too much of an information.Would help everyone if Docker adds some documentation on this topic.