docker-api-rs icon indicating copy to clipboard operation
docker-api-rs copied to clipboard

automatically detect client host endpoint

Open Lohann opened this issue 1 year ago • 1 comments

What did you implement:

Automatically detect the client host endpoint, the same way as docker-cli does.

I've implemented this feature in a project I'm working, so I decided to open a PR here in case you think this could be useful.

Steps

  1. Try to load the endpoint from the DOCKER_CONTEXT environment variable
  2. Try to load the endpoint from the DOCKER_HOST environment variable
  3. Try to load the endpoint from the config.json file
  4. otherwise use the default endpoint

Lohann avatar Aug 27 '23 20:08 Lohann

@vv9k

Lohann avatar Sep 04 '23 23:09 Lohann