#Custom registry mirror appears not to be working

1 messages · Page 1 of 1 (latest)

onyx coral
onyx coral
#

Custom registry mirror appears not to be working

naive heart
# onyx coral I followed the instructions here and I don't think it is working. Grepped throug...

it should work. Buildkit doesn't print any logs when it's using the mirror but here's a way you can validate it works locally.

  1. Pull an alpine image with docker pull alpine:latest
  2. Start a local registry with: docker run -v registry:/var/lib/registry --rm -p 5000:5000 --name registry registry:2
  3. Tag and push the alpine image into your local registry docker tag alpine:latest localhost:5000/library/alpine:latest && docker push localhost:5000/library/alpine:latest
  4. Stop your registry. (ctrl +d should work)
  5. Start your docker engine to use your local registry mirror:
debug = true
insecure-entitlements = ["security.insecure"]

[registry."docker.io"]
  mirrors = ["localhost:5000"]
  http = true
  insecure = true
  1. After your engine starts, start your registry again but connected to your engine: docker run -v registry:/var/lib/registry --rm --net container:$ENGINE_CONTAINER --name registry registry:2

Now if you run a pipeine in Dagger that pulls alpine:latest, you'll see in your registry logs that the image is pulling it from there

onyx coral
#

I’ll try this thanks

onyx coral
#

@naive heart You are awesome btw. Thanks for the detailed writeup and step by step instructions. I was able to confirm the the dagger engine hit the registry. Only suggestion I would have is that the page I references says "You should see the specified hello-world container being pulled from the mirror instead of from Docker Hub." which is a little misleading. Not sure who to provide that feedback to.

naive heart