LXD Custom Images
ฝัง
- เผยแพร่เมื่อ 18 ก.ย. 2024
- In previous videos, I reviewed the lxc command line to work with LXD containers. In this video, I discuss LXD Images and how custom LXD images can be created, maintained and backed up in order to act as templates for creating LXD containers.
Commands used in this video:
LIST ALL LXD IMAGES ON A HOST
lxc image list
CREATE A CONTAINER FROM AN IMAGE
lxc launch ubuntu:20.04 mynewserver --profile default -c security.privileged=true -c limits.memory=2048MB -c limits.cpu.allowance=20% -c boot.autostart=true
lxc image list
lxc image delete 7e8bbf2f2423
CREATE A CUSTOM IMAGE FROM A CONTAINER
lxc stop mynewserver
lxc publish mynewserver --alias mycoolimage description="Ubuntu 20.04 with Goodies"
CREATE A CONTAINER USING AN IMAGE ALIAS
lxc launch mycoolimage mynewserver2 --profile default -c security.privileged=true -c limits.memory=2048MB -c limits.cpu.allowance=20% -c boot.autostart=true
SNAPSHOT AN IMAGE
lxc snapshot mynewserver first-install
CREATE AN IMAGE FROM THE SNAPSHOT
lxc publish myserver/first-install --alias mycoolimage2 description="Added Stuff"
INSPECT AN IMAGE
lxc image info mycoolimage2
EXPORT THE IMAGE
lxc image export mycoolimage2 /share/Container/Backups/mycoolimage2.tar.gz
IMPORT THE IMAGE ON A DIFFERENT SERVER
lxc image import mycoolimage2.tar.gz --alias=mycoolimage2
---------
Come visit us at: www.scottibyte...
Discourse: discussion.sco...
RocketChat: chat.scottibyt...
So glad I have found your channel, what a treasure trove of information. Not sure why you haven't got more subscribers, the content and presentation is excellent. Thank you!
Simon, thanks so much for the kudo. It takes a solid year to get a channel started. Most of the channel is devoted to LXD, with Docker and networking too. I create most of my videos by googling and if I can't find any info, that becomes a tutorial. Come by and chat sometime at chat.scottibyte.com/ and don't forget the visit the Discourse forum with all the show notes at discussion.scottibyte.com/.
Thanks for walking through the different scenarios. Profiles can be added to images via 'lxc image edit'.
Good point. In making these tutorials its hard sometimes to cover everything that might be helpful.