-
Notifications
You must be signed in to change notification settings - Fork 39
Description
I am trying to use the new DOCKER_SOCKET
option that was recently released. Instead of exposing /var/run/docker.sock
directly, I am using a socket-proxy
container (lscr.io/linuxserver/socket-proxy
- https://docs.linuxserver.io/images/docker-socket-proxy) to help secure my environment more.
If I set DOCKER_SOCKET=tcp://socket-proxy:2375
then I receive back the log Docker socket check response sent: available=false
. Note that socket-proxy
is the name of my container. It could be any name or port after the tcp://
portion.
It looks like the code looks specifically for /var/run/docker.sock
and that it does not accept TCP protocols (it is specifically looking for unix).
See:
Lines 52 to 59 in 50b621f
func CheckSocket(socketPath string) bool { | |
// Use the provided socket path or default to standard location | |
if socketPath == "" { | |
socketPath = "/var/run/docker.sock" | |
} | |
// Try to create a connection to the Docker socket | |
conn, err := net.Dial("unix", socketPath) |
I think it will be more than just doing a check and accepting TCP in the above function as I see the code is appending unix to the socketPath
at
Line 83 in 50b621f
client.WithHost("unix://"+socketPath), |
Request: Make the code protocol aware so that security enhancements such as socket-proxy
can be used
Thank you for your condsideration and for this awesome project!