1
0
mirror of https://github.com/rancher/os.git synced 2025-09-20 01:54:53 +00:00
Files
os/pkg/docker/client.go
Olli Janatuinen 872f1cd6da Initiate Burmilla OS project
- Use burmilla GitHub repos
- Release under burmilla Docker Hub
- GitHub action for create releases
- Updated boot image and login banner
- Use Debian as default console
- Updated system-cron to v0.5.0
- Updated services to latest versions
- Bump up kernel to 4.14.206
- Include burmilla/os-debianconsole:v1.9.0 to initrd
2021-02-18 20:07:36 +02:00

31 lines
644 B
Go

package docker
import (
"github.com/burmilla/os/config"
dockerClient "github.com/docker/engine-api/client"
"golang.org/x/net/context"
)
func NewSystemClient() (dockerClient.APIClient, error) {
return NewClient(config.SystemDockerHost)
}
func NewDefaultClient() (dockerClient.APIClient, error) {
return NewClient(config.DockerHost)
}
func NewClient(endpoint string) (dockerClient.APIClient, error) {
client, err := dockerClient.NewClient(endpoint, "", nil, nil)
if err != nil {
return nil, err
}
err = ClientOK(endpoint, func() bool {
_, err := client.Info(context.Background())
return err == nil
})
return client, err
}