Use "${DOCKER_HOST}" when available instead of a hard-coded "/var/run" path for the Docker UNIX socket #34404
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
It is most common to run the Docker daemon as root, in which case the UNIX socket is indeed in
/var/run
; however, there are situations in which it may not be possible to run Docker as root. In those cases, the environment variable${DOCKER_HOST}
is used to indicate the location of the Docker unix socket. This fix aims to allow the use of the build system in environments where Docker is being run in an alternative deployment/location.Testing:
Ran standard build and test with
make
in a context in which/var/run/docker.sock
does not exist but in which${DOCKER_HOST}
was correctly defined; verified that unit tests pass.Documentation:
Updated comments in the affected files. Uncertain if additional documentation changes are required.