Git Product home page Git Product logo

Comments (6)

aeneasr avatar aeneasr commented on August 20, 2024

Good question, from the code it looks like that should be done in the underlying library, as we only pass the endpoint variable to the client instantiation. Could you maybe check if the added the possibility to connect through tcp instead of http?

from dockertest.

aeneasr avatar aeneasr commented on August 20, 2024

So I checked, while docker says that it's exposing on tcp:// the api is still REST so it's http. Are you sure you expose the legacy endpoint for this?

image

from dockertest.

explodingcamera avatar explodingcamera commented on August 20, 2024

Yeah, I'm exposing the legacy endpoint. The tcp:// is just some weird docker convention, it just specifies that they do either http or https over tcp/ip.
It's just that when specifying docker's displayed tcp://localhost:2375, dockertest shouldn't default to https like it currently does but to just pass the endpoint to the underlying library.

Currently everything that's not http:// or unix:// just creates a NewTLSPool no matter what.

I think you just need to change
https://github.com/ory/dockertest/blob/v3/dockertest.go#L104
to if os.Getenv("DOCKER_CERT_PATH") != "" && shouldPreferTls(endpoint) {
because it only needs to do TLS automatically if DOCKER_CERT_PATH actually exists

from dockertest.

tschaub avatar tschaub commented on August 20, 2024

I've been running into the same issues. Things work well with my local docker install on OSX. I'm not having any luck getting the same tests to run in our CI environment where DOCKER_HOST=tcp://172.X.X.X:2375. I assumed this had to do with the insecure-registries setting, but I haven't had any luck updating that either.

from dockertest.

tschaub avatar tschaub commented on August 20, 2024

The change suggested by @explodingcamera does look right.

--- a/dockertest.go
+++ b/dockertest.go
@@ -101,7 +101,7 @@ func NewPool(endpoint string) (*Pool, error) {
                }
        }
 
-       if os.Getenv("DOCKER_CERT_PATH") == "" && shouldPreferTls(endpoint) {
+       if os.Getenv("DOCKER_CERT_PATH") != "" && shouldPreferTls(endpoint) {
                return NewTLSPool(endpoint, os.Getenv("DOCKER_CERT_PATH"))
        }

This has gotten me one step closer. Next up (perhaps unrelated to this lib):

dial tcp 127.0.0.1:32768: getsockopt: connection refused

from dockertest.

tschaub avatar tschaub commented on August 20, 2024

See #106 for @explodingcamera's proposed change.

from dockertest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.