Comments (6)
Indeed, would be really nice to support http for non-localhost.
from containerregistry.
I'm also generally supportive of being able to use HTTP if desired, since in a service mesh, we might know that all connections are TLS, even if that's transparent to the applications.
That being said for any future users that might drop in here, I found that our specific use case of pointing to a k8s pod hostname via http works as long as the fully-qualified hostname is used (e.g. foo.foo-ns.svc.cluster.local
). Seems like somebody has come across this before. :) https://github.com/google/containerregistry/blob/master/client/v2_2/docker_http_.py#L443-L450
from containerregistry.
I also encountered this problem. Some local kubernetes stacks create a virtual node inside a docker container and run everything in there. The kubelets can't access the "localhost" registry from outside their sandbox, but both can access the node IP. If I run a private registry there it has 192.168.9.2 which docker_http.py assumes is HTTPS and I get an odd error message
CRITICAL:root:Error publishing provided image: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:727)
Would it be possible to fix the code so that it first tries https, catches the error, then falls back to http? A properly set up registry should fail http so there should be no security problem that is opened up.
from containerregistry.
After thinking about this, falling back to http would introduce an attack vector. A man-in-the-middle could claim the dns record for some domain, hoping to catch cases where the https failed and the subsequent http request with to this bad guy, who could then deliver an infected image.
Assumming that is the case we should have a way to specify the schema. Consider detecting if http:// or https:// is a prefix on the image name and use in talking to the registry but stripping it for image name purposes, much like is done when specifying a domain other than dockerhub.com
from containerregistry.
Same issue! We also utilize private registry(Harbor) to distribution image or store our project base docker image in internal project. For convenience, Harbor is deployed with HTTP.
And since rules_docker(https://github.com/bazelbuild/rules_docker/blob/master/container/pull.bzl) relies heavily it, if I want to pull internal image to usage, it will fail because of parse scheme and try ping
... ...
(04:06:01) ERROR: Analysis of target '//cmd/webhook:image' failed; build aborted: no such package '@static_base//image': Pull command failed: F0301 04:06:01.489578 378089 __main__.py:147] Error pulling and saving image 192.168.20.38/build/debian:stretch: [Errno 111] Connection refused
My ugly workaround to bind 192.168.20.38 to localhost in /etc/hosts, and update field registry = 'localhost:80'
in WORKSPACE file.
Looking forward to support it
from containerregistry.
jeb2239, can you provide justification for closing this. I still would like this feature added
from containerregistry.
Related Issues (20)
- foreign layers not pulled properly HOT 2
- Example for pulling an image from a remote registry into the docker daemon HOT 3
- error wnhen using docker 2.0.0.3
- error wnhen using docker 2.0.0.3
- error wnhen using docker 2.0.0.3
- error wnhen using docker 2.0.0.3 HOT 2
- error wnhen using docker 2.0.0.3
- auth error when using default config.json from docker 2.0.0.3 HOT 4
- fast_puller_.py pulls the wrong image from GCR HOT 2
- forced url server specification fails to match for docker-credentials-secretservice
- fast_puller_.py pulls an image with an unknown SHA256 from quay.io HOT 1
- Pushes to gitlab fail with SSL error HOT 6
- Pushes to gitlab fail with SSL error HOT 1
- save.py: digest file writing thread bugs
- Doens't work with Bazel 0.25.0 because it uses Python 3 by default HOT 7
- containerregistry in Pypi
- image_digester.py fails to run on Python3-default systems HOT 1
- Is there a unittest suite for this code? HOT 1
- Support images larger than 2GiB in docker_session.upload() HOT 3
- Docker Puller tool does not work with Dockerhub images HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from containerregistry.