LXC
Incusをインストールする
for lego
$ sudo zypper --gpg-auto-import-keys refresh
$ sudo zypper install -y incus incus-tools incus-zsh-completion
$ sudo usermod -aG incus-admin "$USER"
ここでいったんログアウトしてグループを反映させる
Incusを起動する
$ sudo systemctl enable --now incus
code:sh
λ incus admin init
Would you like to use clustering? (yes/no) default=no: no Do you want to configure a new storage pool? (yes/no) default=yes: yes Name of the storage backend to use (lvm, btrfs, dir) default=btrfs: Would you like to create a new btrfs subvolume under /var/lib/incus? (yes/no) default=yes: Would you like to create a new local network bridge? (yes/no) default=yes: What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) default=auto: What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) default=auto: Would you like the server to be available over the network? (yes/no) default=no: Would you like stale cached images to be updated automatically? (yes/no) default=yes: Would you like a YAML "init" preseed to be printed? (yes/no) default=no: yes config: {}
networks:
- config:
ipv4.address: auto
ipv6.address: auto
description: ""
name: incusbr0
type: ""
project: default
storage_pools:
- config:
source: /var/lib/incus/storage-pools/default
description: ""
name: default
driver: btrfs
storage_volumes: []
profiles:
- config: {}
description: ""
devices:
eth0:
name: eth0
network: incusbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
project: default
projects: []
certificates: []
cluster_groups: []
cluster: null
これで専用ストレージが生えてネットワークブリッジもできた状態になる
$ incus launch images:debian/12 foo
LXCコンテナfooができる
$ incus exec foo -- bash -c 'cat /etc/os-release | head -2; whoami; uname -r'
docker execと同じ
$ incus delete --force foo
コンテナを破壊
なんかネットの疎通の調子が悪い
内から外にうまくDNSが疎通してない
FWに遮断されてた
$ sudo firewall-cmd --permanent --zone=trusted --change-interface=incusbr0
$ sudo firewall-cmd --reload
distrobuilder
$ sudo zypper install -y distrobuilder debootstrap