firecracker-containerd
firecracker-containerd copied to clipboard
How to config image registry?
Hi,
I'd like to understand how to config the credential or http access of an image registry in firecracker-containerd, like this: containerd-Configure Image Registry ? I need to use a local image registry which only provides http access. I know the command line provides --plain-http option to access insecure registry. But I'm using go sdk to invoke firecraker-containerd, not via command line. I would get error "http: server gave HTTP response to HTTPS client" when starting a VM. Is it possible to config when I use go sdk ?
Thanks.
You can do this by setting a custom resolver when calling pull:
insecureResolver := docker.NewResolver(docker.ResolverOptions{
PlainHTTP: true,
Client: http.DefaultClient,
})
image, err := client.Pull(ctx, IMAGE_NAME, containerd.WithPullUnpack, containerd.WithResolver(insecureResolver))