Example #1
0
func New() *Docker {
	return &Docker{
		UUID:    uuid.New(),
		Kind:    dockerKind,
		Created: time.Now().UTC().Unix(),
		docker:  docker.New(),
	}
}
Example #2
0
// setup a mock docker client for testing purposes. This will use
// a test http server that can return mock responses to the docker client.
func setup() {
	mux = http.NewServeMux()
	server = httptest.NewServer(mux)

	url, _ := url.Parse(server.URL)
	url.Scheme = "tcp"
	os.Setenv("DOCKER_HOST", url.String())
	client = docker.New()
}