当前位置: 首页 > 工具软件 > lxd-images > 使用案例 >

LXC/LXD缓存镜像至本地

锺离玮
2023-12-01

背景

使用LXC/LXD时想像docker一样先把镜像缓存到本地,但是不知道如何操作,探究许久发现真相。

操作

afu@instance-lxc:~$ lxc image copy ubuntu:18.04 local:
Image copied successfully!
afu@instance-lxc:~$ lxc image list
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+
| ALIAS | FINGERPRINT  | PUBLIC |                  DESCRIPTION                  |  ARCH  |   SIZE   |         UPLOAD DATE         |
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+
|       | 9e7158fc0683 | no     | ubuntu 18.04 LTS amd64 (release) (20200129.1) | x86_64 | 178.73MB | Feb 5, 2020 at 5:07am (UTC) |
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+
afu@instance-lxc:~$ lxc image copy ubuntu:16.04 local:
Image copied successfully!                   
afu@instance-lxc:~$ lxc image list
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+
| ALIAS | FINGERPRINT  | PUBLIC |                  DESCRIPTION                  |  ARCH  |   SIZE   |         UPLOAD DATE         |
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+
|       | 62c59cf09683 | no     | ubuntu 16.04 LTS amd64 (release) (20200129)   | x86_64 | 159.20MB | Feb 5, 2020 at 9:03am (UTC) |
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+
|       | 9e7158fc0683 | no     | ubuntu 18.04 LTS amd64 (release) (20200129.1) | x86_64 | 178.73MB | Feb 5, 2020 at 5:07am (UTC) |
+-------+--------------+--------+-----------------------------------------------+--------+----------+-----------------------------+

总结

凡事多动手,多动手。

 类似资料: