mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat(wip): docker ui only
This commit is contained in:
parent
c62fd25b2e
commit
d4a4ed1e1c
43 changed files with 1269 additions and 372 deletions
22
internal/docker/docker.go
Normal file
22
internal/docker/docker.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package docker
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
)
|
||||
|
||||
// Initialize Docker client from environment variables
|
||||
func initClient() (cli *client.Client, err error) {
|
||||
cli, err = client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// Optionally ping the server to ensure the connection is valid
|
||||
_, err = cli.Ping(context.Background())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue