Would you like to use clustering? (yes/no) [default=no]: ###是否使用集群,一般来说不需要。 Do you want to configure a new storage pool? (yes/no) [default=yes]: ###是否配置新的存储池,一般来说需要。 Name of the new storage pool [default=default]: ###新存储池的名称,默认即可。 Name of the storage backend to use (dir, lvm, lvmcluster, zfs, btrfs) [default=zfs] ###要使用的存储后端名称。 Create a new ZFS pool? (yes/no) [default=yes]: Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: Size in GiB of the new loop device (1GiB minimum) [default=5GiB]: Would you like to create a new local network bridge? (yes/no) [default=yes]: ###是否创建新的本地网络桥,一般来说需要。 What should the new bridge be called? [default=incusbr0]: ###网桥的接口名称,默认即可。 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]: ###IPv4 和 IPv6 地址,一般来说都需要。如果服务器没有 IPv6,可以将 IPv6 设置为 none。 Would you like the server to be available over the network? (yes/no) [default=no]: ###是否允许通过网络访问 Incus 服务,随意。 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]:
root@fn-j1900:~# incus launch images:debian/14 my-app Launching my-app root@fn-j1900:~# incus list +--------+---------+----------------------+------------------------------------------------+-----------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +--------+---------+----------------------+------------------------------------------------+-----------+-----------+ | my-app | RUNNING | 10.201.74.116 (eth0) | fd42:3c8d:c3ff:91bb:1266:6aff:fec3:eee4 (eth0) | CONTAINER | 0 | +--------+---------+----------------------+------------------------------------------------+-----------+-----------+ root@fn-j1900:~# incus exec my-app bash root@my-app:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host proto kernel_lo valid_lft forever preferred_lft forever 25: eth0@if26: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 10:66:6a:c3:ee:e4 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.201.74.116/24 metric 1024 brd 10.201.74.255 scope global dynamic eth0 valid_lft 3576sec preferred_lft 3576sec inet6 fd42:3c8d:c3ff:91bb:1266:6aff:fec3:eee4/64 scope global mngtmpaddr noprefixroute valid_lft forever preferred_lft forever inet6 fe80::1266:6aff:fec3:eee4/64 scope link proto kernel_ll valid_lft forever preferred_lft forever root@my-app:~# apt update Get:1 http://deb.debian.org/debian forky InRelease [148 kB] Get:2 http://deb.debian.org/debian forky-updates InRelease [45.1 kB] Get:3 http://deb.debian.org/debian-security forky-security InRelease [48.0 kB] Get:4 http://deb.debian.org/debian forky/main amd64 Packages.diff/Index [63.6 kB] Get:5 http://deb.debian.org/debian forky/main Translation-en.diff/Index [63.6 kB] Get:6 http://deb.debian.org/debian forky/main amd64 Packages T-2026-04-26-2001.18-F-2026-04-26-0803.51.pdiff [31.4 kB] Get:6 http://deb.debian.org/debian forky/main amd64 Packages T-2026-04-26-2001.18-F-2026-04-26-0803.51.pdiff [31.4 kB] Get:7 http://deb.debian.org/debian forky/main Translation-en T-2026-04-26-2001.18-F-2026-04-26-0803.51.pdiff [3306 B] Get:7 http://deb.debian.org/debian forky/main Translation-en T-2026-04-26-2001.18-F-2026-04-26-0803.51.pdiff [3306 B] Fetched 403 kB in 9s (47.4 kB/s) All packages are up to date. Notice: Some sources can be modernized. Run 'apt modernize-sources' to do so. root@my-app:~# apt install nginx Installing: nginx
Installing dependencies: nginx-common
Suggested packages: fcgiwrap nginx-doc ssl-cert
Summary: Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 0 Download size: 754 kB Space needed: 1987 kB / 4380 MB available
Continue? [Y/n] y Get:1 http://deb.debian.org/debian forky/main amd64 nginx-common all 1.30.0-2 [108 kB] Get:2 http://deb.debian.org/debian forky/main amd64 nginx amd64 1.30.0-2 [646 kB] Fetched 754 kB in 1s (856 kB/s) Preconfiguring packages ... Selecting previously unselected package nginx-common. (Reading database ... 13329 files and directories currently installed.) Preparing to unpack .../nginx-common_1.30.0-2_all.deb ... Unpacking nginx-common (1.30.0-2) ... Selecting previously unselected package nginx. Preparing to unpack .../nginx_1.30.0-2_amd64.deb ... Unpacking nginx (1.30.0-2) ... Setting up nginx-common (1.30.0-2) ... Created symlink '/etc/systemd/system/multi-user.target.wants/nginx.service' → '/usr/lib/systemd/system/nginx.service'. Setting up nginx (1.30.0-2) ... Upgrading binary: nginx. root@my-app:~# systemctl start nginx root@my-app:~# curl http://127.0.0.1 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, nginx is successfully installed and working. Further configuration is required for the web server, reverse proxy, API gateway, load balancer, content cache, or other features.</p>
<p>For online documentation and support please refer to <a href="https://nginx.org/">nginx.org</a>.<br/> To engage with the community please visit <a href="https://community.nginx.org/">community.nginx.org</a>.<br/> For enterprise grade support, professional services, additional security features and capabilities please refer to <a href="https://f5.com/nginx">f5.com/nginx</a>.</p>
<p><em>Thank you for using nginx.</em></p> </body> </html> root@my-app:~# exit exit
资源限制: 以下命令限制了 CPU 为 1 个核心,内存为 256MB: incus launch images:debian/14 my-app --config limits.cpu=1 --config limits.memory=256MiB 使用incus config show my-app 查看详细。
root@fn-j1900:~# incus config device add my-app proxy80 proxy listen=tcp:0.0.0.0:8080 connect=tcp:10.201.74.116:80 Device proxy80 added to my-app root@fn-j1900:~# curl 127.0.0.1:8080 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, nginx is successfully installed and working. Further configuration is required for the web server, reverse proxy, API gateway, load balancer, content cache, or other features.</p>
<p>For online documentation and support please refer to <a href="https://nginx.org/">nginx.org</a>.<br/> To engage with the community please visit <a href="https://community.nginx.org/">community.nginx.org</a>.<br/> For enterprise grade support, professional services, additional security features and capabilities please refer to <a href="https://f5.com/nginx">f5.com/nginx</a>.</p>
<p><em>Thank you for using nginx.</em></p> </body> </html> root@fn-j1900:~# incus info my-app Name: my-app Description: Status: RUNNING Type: container Architecture: x86_64 PID: 7616 Created: 2026/04/27 10:43 CST Last Used: 2026/04/27 10:43 CST Started: 2026/04/27 10:43 CST
Resources: Processes: 21 Disk usage: root: 88.44MiB CPU usage: CPU usage (in seconds): 25 Memory usage: Memory (current): 113.82MiB Network usage: eth0: Type: broadcast State: UP Host interface: veth13638545 MAC address: 10:66:6a:c3:ee:e4 MTU: 1500 Bytes received: 1.21MB Bytes sent: 38.50kB Packets received: 447 Packets sent: 420 IP addresses: inet: 10.201.74.116/24 (global) inet6: fd42:3c8d:c3ff:91bb:1266:6aff:fec3:eee4/64 (global) inet6: fe80::1266:6aff:fec3:eee4/64 (link) lo: Type: loopback State: UP MTU: 65536 Bytes received: 9.75kB Bytes sent: 9.75kB Packets received: 92 Packets sent: 92 IP addresses: inet: 127.0.0.1/8 (local) inet6: ::1/128 (local)