docker-api-rs
docker-api-rs copied to clipboard
automatically detect client host endpoint
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
- Try to load the endpoint from the
DOCKER_CONTEXT
environment variable - Try to load the endpoint from the
DOCKER_HOST
environment variable - Try to load the endpoint from the
config.json
file - otherwise use the default endpoint
@vv9k