-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
support registry mirrors for image scanning #7966
Comments
@DmitriyLewen Could you investigate how each container engine works with mirror settings? As I recall, the behavior is to try a mirror first and then pull from the original registry if the mirror returned a 404, but I think it would be better to investigate properly. |
I'm interested in this feature. We use a mirror to bypass Docker API Rate limit :) |
We have several mirrors for each registry. Please handle this use case. The behavior of containerd is to try the mirrors in the specified order and try direct access as a last resort (or There is also the /v2 path which should be configurable (see I think using a configuration similar to containerd will help, like: registry-mirrors:
docker.io:
# server: https://registry-1.docker.io
# skip_verify: false
# ca: [/etc/certs/test-1-ca.pem, /etc/certs/special.pem]
# override_path: false
host."https://mirror.registry": {}
host."https://mirror2.registry/v2/external-registries/docker.io":
override_path: true
|
I checked I also checked So we need to create this logic in Trivy. cc. @knqyf263 |
Thanks, that sounds good to me. |
Discussed in #4957
When scanning images, Trivy is pulling the container image from registry directly (using OCI API). Most container engines support "mirroring", which tells the engine to pull certain images from another registry instead of the user specified.
Example from Docker: https://docs.docker.com/docker-hub/mirror/#configure-the-docker-daemon
Trivy should support similar functionality for pulling images from a mirror if configured. Since mirror configuration varies between engines, we should not support one of the existing ones but allow users to configure specifically for Trivy.
As @caleb-devops suggested:
it could be supported on cli as
--registry-mirrors docker.io:harbor.example.com/docker.io
, but since this is advanced use case it might be ok to keep it config file exclusive.The text was updated successfully, but these errors were encountered: