Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.13] It seems that "registry.insecure=true" doesn't work. #4915

Closed
SihengCui opened this issue May 13, 2024 · 7 comments · Fixed by #4975
Closed

[v0.13] It seems that "registry.insecure=true" doesn't work. #4915

SihengCui opened this issue May 13, 2024 · 7 comments · Fixed by #4975
Assignees
Milestone

Comments

@SihengCui
Copy link

It seems that "registry.insecure=true" doesn't work.
My registry only supports HTTP protocol and 80 port.
image
But in v0.11.6 it works well.
image

@tonistiigi
Copy link
Member

@vvoland Related to #4299 ?

@vvoland
Copy link
Collaborator

vvoland commented May 14, 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.

@vvoland
Copy link
Collaborator

vvoland commented May 14, 2024

@profnandaa
Copy link
Collaborator

Cross-linking docker/buildx#2226, related?

@SihengCui
Copy link
Author

@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.

@tonistiigi
Copy link
Member

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?

@vvoland
Copy link
Collaborator

vvoland commented May 16, 2024

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

It works fine with graphdrivers.

@thompson-shaun thompson-shaun added this to the v0.14.0 milestone May 23, 2024
@thompson-shaun thompson-shaun changed the title It seems that "registry.insecure=true" doesn't work. [v0.13] It seems that "registry.insecure=true" doesn't work. May 23, 2024
@thompson-shaun thompson-shaun modified the milestones: v0.14.0, v0.13.3 May 23, 2024
@crazy-max crazy-max modified the milestones: v0.13.3, v0.14.0 May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants