Skip to content

Commit

Permalink
docker api enforces tls from docker 1.13 onwards
Browse files Browse the repository at this point in the history
For docker 1.13 onwards, not using `dc.NewTLSClient` will fail with malformed http response.

Also, is there an option in dockertest v3 to support docker-machine? There was an option to support docker-machine in v2 but I can't seem to find it in v3. Providing such an option will allow us to use `dc.NewClientFromEnv()`.
  • Loading branch information
calvinchengx committed Feb 19, 2017
1 parent 7bf7a60 commit 97abb20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dockertest.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ func NewPool(endpoint string) (*Pool, error) {
}
}

client, err := dc.NewClient(endpoint)
// docker machine cert path, not sure how it applies to non-docker machine scenarios
path := os.Getenv("DOCKER_CERT_PATH")
ca := fmt.Sprintf("%s/ca.pem", path)
cert := fmt.Sprintf("%s/cert.pem", path)
key := fmt.Sprintf("%s/key.pem", path)

client, err := dc.NewTLSClient(endpoint, cert, key, ca)
if err != nil {
return nil, errors.Wrap(err, "")
}
Expand Down

0 comments on commit 97abb20

Please sign in to comment.