mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 12:40:25 +08:00
17 lines
304 B
Go
17 lines
304 B
Go
package data
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/moby/moby/client"
|
|
)
|
|
|
|
func getDockerClient(sock string) (*client.Client, error) {
|
|
apiClient, err := client.New(client.WithHost(fmt.Sprintf("unix://%s", sock)), client.WithAPIVersionNegotiation())
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return apiClient, nil
|
|
}
|