Git Product home page Git Product logo

Comments (7)

tonistiigi avatar tonistiigi commented on June 3, 2024

@vvoland Related to #4299 ?

from buildkit.

vvoland avatar vvoland commented on June 3, 2024

Hmm right, registry.insecure=true sets both "insecure https" and "http only" options which makes it use the http fallback.

if c.Insecure != nil && *c.Insecure {
h2 := h
var transport http.RoundTripper = httpsTransport
if isHTTP {
transport = &httpFallback{super: transport}
}
h2.Client = &http.Client{
Transport: tracing.NewTransport(transport),
}
tc.InsecureSkipVerify = true
return &h2, nil
} else if isHTTP {
h2 := h
h2.Scheme = "http"
return &h2, nil
}

However, the http only kicks-in, if the https connection fails with a TLS error. In this case the error is different (connection refused), so the connection doesn't fallback to http.

from buildkit.

vvoland avatar vvoland commented on June 3, 2024

The http fallback in containerd also only checks for the tls error: https://github.com/containerd/containerd/blob/536608ef227e0825c7c49d59a71a698cc8039ff5/core/remotes/docker/resolver.go#L735

cc @dmcgowan

from buildkit.

profnandaa avatar profnandaa commented on June 3, 2024

Cross-linking docker/buildx#2226, related?

from buildkit.

SihengCui avatar SihengCui commented on June 3, 2024

@vvoland
Related to #4299 ?
I change buildkitd.toml

[registry."xxxx"]
  http = true
  insecure = true

to

[registry."xxxx"]
  http = true

and remove the buildctl option registry.insecure=true.
It works well.
Thx.

from buildkit.

tonistiigi avatar tonistiigi commented on June 3, 2024

The http fallback in containerd also only checks for the tls error:

@vvoland But that is not the behavior of moby, with host defined in insecure-registries, right?

from buildkit.

vvoland avatar vvoland commented on June 3, 2024

It is, but only with the containerd integration (because it uses the same resolver as buildkit).

It works fine with graphdrivers.

from buildkit.

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.