about summary refs log tree commit diff
path: root/src/docker.go
blob: 9bc667b24b6fc05e3f2cbaa2cc88f7ffe30579a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

import (
	"github.com/docker/docker/client"
	"context"
)

var (
	dockerCtx context.Context
	dockerCli *client.Client
)

func setupContext() {
	if dockerCtx == nil {
		dockerCtx = context.Background()
	}
}

func setupDockerCLI() (err error) {
	if dockerCli == nil {
		dockerCli, err = client.NewEnvClient()
	}

	return err
}