Skip to content

Commit

Permalink
chore: initialise DockerSocketPath on init
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Mar 27, 2024
1 parent 20caafd commit 853b194
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/core/docker_socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ func init() {
DockerSocketPath = "/" + DockerSocketPath
}
}

cli, err := NewClient(context.Background())
if err != nil {
panic(err) // a Docker client is required to get the Docker info
}
defer cli.Close()

DockerSocketPath = checkDefaultDockerSocket(context.Background(), cli, DockerSocketPath)
}

// checkDefaultDockerSocket checks the docker socket path and returns the correct path depending on the Docker client configuration,
Expand Down

0 comments on commit 853b194

Please sign in to comment.