chore: improved command for container creation with template

This commit is contained in:
Michele Cereda
2023-07-21 22:23:14 +02:00
parent 1daba11371
commit 5116d2f56b
2 changed files with 18 additions and 3 deletions

View File

@@ -16,9 +16,20 @@ snap install 'lxd'
# List available templates. # List available templates.
ls '/usr/share/lxc/templates' ls '/usr/share/lxc/templates'
# List the options supported by templates.
lxc-create -t 'download' -h
# Create new containers. # Create new containers.
# Use the 'download' template to choose from a list of distribution # Use the 'download' template to choose from a list of distribution.
lxc-create -n 'pi-hole' --template 'download' lxc-create -n 'nas' --template 'download'
# Values are case sensitive and depend from what is on the server.
lxc-create -n 'pi-hole' -t 'download' -- \
--server 'images.linuxcontainers.org' \
--dist 'debian' --release 'bullseye' --arch 'armhf' --variant 'cloud'
lxc-create -n 'git' -t 'download' -- \
--server 'repo.turris.cz/lxc' \
-d 'Debian' -r 'Bullseye' -a 'armv7l'
# Start containers. # Start containers.
lxc-start -n 'pi-hole' lxc-start -n 'pi-hole'

View File

@@ -181,8 +181,12 @@ In shell:
```sh ```sh
# Default source is 'repo.turris.cz/lxc'. # Default source is 'repo.turris.cz/lxc'.
# Values for the template options are case sensitive.
lxc-create --name 'test' --template 'download' lxc-create --name 'test' --template 'download'
lxc-create -n 'pi-hole' -t 'download' -- --dist 'debian' --release 'bullseye' --arch 'armhf' --server 'images.linuxcontainers.org' lxc-create -n 'git' -t 'download' -- -d 'Debian' -r 'Bullseye' -a 'armv7l'
lxc-create -n 'pi-hole' -t 'download' --
--server 'images.linuxcontainers.org' \
--dist 'debian' --release 'bullseye' --arch 'armhf'
``` ```
Using the WebUI: Using the WebUI: