firecracker-containerd icon indicating copy to clipboard operation
firecracker-containerd copied to clipboard

How to config image registry?

Open guoyingc opened this issue 4 years ago • 1 comments

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.

guoyingc avatar Aug 06 '21 02:08 guoyingc

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))

Kern-- avatar Aug 13 '21 15:08 Kern--