Skip to content

Commit cf74e21

Browse files
committed
doc: document the image registries concept
1 parent db1b19b commit cf74e21

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

doc/registries.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Virter Image Registries
2+
3+
In order to know where to look when pulling VM images, virter uses a mechanism
4+
called an "image registry" to map an image's name to an URL where the VM image
5+
can be downloaded.
6+
7+
## File structure
8+
9+
Image registry files are simple enough in principle:
10+
11+
```toml
12+
[ubuntu-focal]
13+
url = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
14+
```
15+
16+
A registry file is just a [toml](https://github.com/toml-lang/toml) file, with
17+
each section corresponding to an image and a `url` key to specify the VM image
18+
location.
19+
20+
## Locations
21+
22+
Virter tries to load its image registry from two locations:
23+
24+
* `$XDG_DATA_HOME/virter` (defaults to `$HOME/.local/share/virter`). This is the
25+
"shipped" image registry.
26+
* `$CONFIG_DIR/images.toml` where `$CONFIG_DIR` is defined as the path where
27+
virters configuration file (`virter.toml`) is stored. This is the "user-defined"
28+
image registry.
29+
30+
### Shipped Registry
31+
32+
The shipped image registry file is pre-populated with some sensible default images,
33+
which represents some commonly used distributions. It is maintained by the
34+
virter maintainers.
35+
36+
If the shipped image registry file does not exist, it is fetched from a well-known
37+
static url (https://linbit.github.io/virter/images.toml). The shipped registry
38+
can also be updated manually, using the `virter registry update` command.
39+
40+
### User-Defined Registry
41+
42+
The user-defined image registry file resides next to `virter.toml`, virters
43+
configuration file. It usually does not exist, but can be created by the user
44+
to define additional images or override images from the shipped registry.
45+
46+
When virter loads its image registry, it first loads the shipped registry file.
47+
Then, it loads the user-defined registry file. When the name of an image collides
48+
with an already defined name from the shipped registry, it is overridden.
49+
50+
The combined contents of the image registries can be viewed by using
51+
`virter image ls --available`.

0 commit comments

Comments
 (0)