Motivation:
Currently an application that would like to integrate with Docker by calling it's APIs has to either rely on docker listening on the default socket or be (manually) configured with the socket in case it differs from the default.
Such an application can try detecting the socket by parsing a running Docker process command line parameters and might need to parse the Docker configuration file. However, this duplicates Docker's logic inside the application and it's very brittle. Inspecting Docker's open file descriptors (e.g. through /proc) is not optimal either as file descriptors other than the API socket/s are held open.
Exposing the API sockets may also facilitate Docker CLI such that it will be able to communicate with a Docker host that is not listening on the default socket (changes to Docker CLI will go into a separate issue).
Implementation:
The idea is to publish the socket info into a file, say similar to publishing the Docker PID through the docker.pid file.
Motivation:
Currently an application that would like to integrate with Docker by calling it's APIs has to either rely on docker listening on the default socket or be (manually) configured with the socket in case it differs from the default.
Such an application can try detecting the socket by parsing a running Docker process command line parameters and might need to parse the Docker configuration file. However, this duplicates Docker's logic inside the application and it's very brittle. Inspecting Docker's open file descriptors (e.g. through /proc) is not optimal either as file descriptors other than the API socket/s are held open.
Exposing the API sockets may also facilitate Docker CLI such that it will be able to communicate with a Docker host that is not listening on the default socket (changes to Docker CLI will go into a separate issue).
Implementation:
The idea is to publish the socket info into a file, say similar to publishing the Docker PID through the docker.pid file.