Skip to content

[Feature Request] Make Docker Socket feature protocol aware #62

@beefstew809

Description

@beefstew809

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:

newt/docker/client.go

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

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions