How to manage image registries¶
Image registries store information about global, read-only sources of images, such as SimpleStreams servers or other LXD servers. You can use image registries to centrally define and manage the image sources that are accessible to all members of the cluster. Once you create an image registry, you can use it to download images for LXD.
Create an image registry¶
The requirements for creating a new image registry depend on the protocol used by the image source.
To create a registry for an image source that uses the lxd protocol, you must connect to the remote LXD server through a cluster link.
Use a public cluster link for a public LXD server, or a unidirectional or bidirectional cluster link to authenticate to a private server.
Use the required cluster configuration key to specify the cluster link:
lxc image registry create <registry_name> cluster=<cluster_link_name> source_project=<project>
Send a POST request to the /1.0/image-registries endpoint, specifying the required cluster configuration key:
lxc query --request POST /1.0/image-registries --data '{"name": "my-registry", "config": {"cluster": "my-cluster-link", "source_project": "default"}}'
See POST /1.0/image-registries for more information.
To create a registry for an image source that uses the simplestreams protocol, specify the URL of the SimpleStreams server.
Use the required url configuration key to specify the SimpleStreams server:
lxc image registry create <registry_name> url=<URL>
Send a POST request to the /1.0/image-registries endpoint, specifying the required url configuration key:
lxc query --request POST /1.0/image-registries --data '{"name": "my-registry", "config": {"url": "https://images.example.org"}}'
See POST /1.0/image-registries for more information.
View image registries¶
To list all configured image registries, run:
lxc image registry list
To view the configuration of a specific image registry, run:
lxc image registry show <registry_name>
To list all image registries, send the following request:
lxc query --request GET /1.0/image-registries
To view the configuration of a specific image registry, send the following request:
lxc query --request GET /1.0/image-registries/<name>
See GET /1.0/image-registries and GET /1.0/image-registries/{name} for more information.
Configure an image registry¶
You can edit the configuration for an image registry in your text editor or set specific configuration options.
To edit an image registry in your default text editor, run:
lxc image registry edit <registry_name>
To set a specific configuration option, run:
lxc image registry set <registry_name> <key> <value>
For example, to update the source project:
lxc image registry set my-registry source_project foo
To update an image registry, send a PUT or PATCH request to the /1.0/image-registries/<name> endpoint.
lxc query --request PATCH /1.0/image-registries/my-registry --data '{"description": "New description"}'
See PUT /1.0/image-registries/{name} and PATCH /1.0/image-registries/{name} for more information.
For a list of available configuration options, see Image registries.
Delete an image registry¶
To delete an image registry, run:
lxc image registry delete <registry_name>
lxc query --request DELETE /1.0/image-registries/<name>
See DELETE /1.0/image-registries/{name} for more information.