docker build tries to use https for insecure-hosts
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 682
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 29
Description
- I have tried with the latest version of Docker Desktop
- I have tried disabling enabled experimental features
- I have uploaded Diagnostics
Actual behavior
A docker build based on an image from an insecure registry gives an error like this:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head "https://my-registry:5000/v2/openjdk/openjdk-11-rhel7/manifests/latest": http: server gave HTTP response to HTTPS client
While this registry is in the insecure-hosts list. docker info shows that it is.
Then when I do docker pull that same image it being pulled ok. And then I can build ok
Expected behavior
Always use http for 'insecure-hosts'
Information
- Windows Version:
21H1 - Docker Desktop Version:
4.1.1 - WSL2 or Hyper-V backend?
wsl2 - Are you running inside a virtualized Windows e.g. on a cloud server or a VM:
no - Is it reproducible?
Yep. In 4.1.1 and 4.1.0 - Is the problem new?
Never encountered it before. I've been using docker for a while. - Did the problem appear with an update?
Not sure. At first I thought it did, but then I downgraded from 4.1.1 to 4.1.0 and it stayed
Steps to reproduce the behavior
- put some image into insecure registry
- build based on it while it is not yet cached
- here you are
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, test, or entry point is named in the report. Reproduce the listed build against an uncached image in an insecure registry, then trace how the build path handles the insecure-hosts setting compared with docker pull. Done means the build uses the configured insecure registry protocol and the reproduction no longer fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100