nixos-config/modules/flake-parts/incus-image/README.md
2025-02-24 11:28:48 -05:00

29 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Workflows for [my lxd/incus configuration](https://github.com/srid/nixos-config/blob/master/modules/nixos/linux/lxd.nix).
To build the image,
```sh
nix run .#incus-image-container-import public-container
```
To launch a container using it,
```sh
incus launch srid/public-container --ephemeral test
```
`public-container` runs nginx serving Hello world, which can test if the container is working.
```sh
# Find the IP
incus list
+------+---------+----------------------+-----------------------------------------------+-----------------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+----------------------+-----------------------------------------------+-----------------------+-----------+
| test | RUNNING | 10.162.27.156 (eth0) | fd42:ef6e:8271:3b9f:216:3eff:fea2:b8a6 (eth0) | CONTAINER (EPHEMERAL) | 0 |
+------+---------+----------------------+-----------------------------------------------+-----------------------+-----------+
# curl container's nginx
curl 10.162.27.156
Hello World%
```