
我已經安裝了一台新伺服器,安裝了 Ubuntu Server 並為 apt 安裝了 LXC。我一直在閱讀文件並嘗試了解如何匯入圖像/模板。我很難理解如何匯入公共圖像列表,特別是如何使用 Alpine 設定新實例。我相信這可以透過 ISO 的 tarball(來自手冊頁)來完成,但還有一個遠端選項。
LXC 容器列表在這裡:https://us.images.linuxcontainers.org/說這些可以透過 lxc-download 模板獲得,我認為這是觸發模板的命令,但現在我更困惑了。
答案1
如果使用 LXC,通常您會使用以下指令設定一個新容器:
lxc-create -n ${c} -t download -- -d ${d} -r ${r} -a amd64
其中c
是您選擇的容器名稱,d
是發行版(例如“alpine”),r
是發行版的版本號。這是一個例子:
# lxc-create -n test -t download -- -d alpine -r 3.12 -a amd64
The cached copy has expired, re-downloading...
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs
---
You just created an Alpinelinux 3.12 x86_64 (20201213_13:00) container.