Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Document how to run your own proxy registry #344

Open
castrojo opened this issue Aug 15, 2023 · 3 comments
Open

Document how to run your own proxy registry #344

castrojo opened this issue Aug 15, 2023 · 3 comments

Comments

@castrojo
Copy link
Member

For local dev and for people with multiple machines ... it'd be nice to be able to just run a proxy to cache stuff, ala apt-cache-ng back in the day!

https://tanzu.vmware.com/developer/guides/harbor-as-docker-proxy/

@castrojo castrojo changed the title Document how to run your own harbor proxy Document how to run your own proxy registry Oct 15, 2023
@castrojo
Copy link
Member Author

Ok I got this from @p5 and I'm able to successfully cache pulls and other OCI artifacts, but it errors out on the signed images.

I'm pretty sure it's a configuration issue but I haven't had time to investigate, tossing my config in here.

jorge@trunks ~/registry % cat docker-compose.yml 
version: '3'
services:
  registry:
    image: registry:2
    ports:
      - "5000:5000"
    environment:
      REGISTRY_STORAGE_DELETE_ENABLED: "true"
      REGISTRY_LOG_LEVEL: "info"
      REGISTRY_PROXY_REMOTEURL: https://ghcr.io

@castrojo
Copy link
Member Author

From discord:

Robert (p5): Not sure if/how to get it to work for multiple registries or homebrew, but the simplest thing I could get working is:

# /etc/containers/registries.conf.d/001-ghcr-cache.conf

[[registry]]
prefix = "ghcr.io"
location = "localhost:5000"
insecure = true
# /etc/containers/systemd/cache.container

[Unit]
Description=Container Image Cache
After=network-online.target

[Container]
Image=docker.io/library/registry:2
ContainerName=registry
PublishPort=5000:5000
Environment=REGISTRY_STORAGE_DELETE_ENABLED=true
Environment=REGISTRY_PROXY_REMOTEURL=https://ghcr.io
Volume=registry:/var/lib/registry

[Install]
WantedBy=multi-user.target default.target

@b-
Copy link
Contributor

b- commented Oct 15, 2023

I posted these links in the discord but I’ll put them here, too, for posterity’s sake: https://developer.skao.int/en/latest/tools/containers/docker-proxy-cache.html#id16 they're using a different way of specifying the mirror here, so I wonder if this would help.

Also that site mentions using sonatype registry as a proxy as well, which looks interesting but also maybe kind of heavy. And I don’t think it’s completely FOSS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants