1

I'm trying to find the DOCKER_HOST for my docker registry.

Looking at the sdk, I know it's possible to set the DOCKER_HOST.

enter image description here

But is it possible to find the current DOCKER_HOST been used?

import docker
client = docker.from_env()
client.info()
user3292394
  • 609
  • 2
  • 11
  • 24

1 Answers1

1

DOCKER_HOST is an optional value.

The default Docker host (and local registry) is a socket on localhost. I wouldn't expect that you'll find a DOCKER_HOST set unless you have chosen to set one.

Various things can override, however, so it really depends on your local environment and setup.

  • DOCKER_HOST value
  • DOCKER_CONTEXT value
  • A context set using the docker context command
  • A context set using the -c flag to the docker command

Reference (docs.docker.com)

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112