MusicDin / lxd-imagebuilder-old

LXD Image Builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LXD Imagebuilder

System container and VM image builder for LXD and LXC.

Status

Type Service Status
CI GitHub Build Status
Project status CII Best Practices CII Best Practices

Command line options

The following are the command line options of lxd-imagebuilder. You can use lxd-imagebuilder to create container images for both LXD and LXC.

$ lxd-imagebuilder
System container and VM image builder for LXD and LXC

Usage:
  lxd-imagebuilder [command]

Available Commands:
  build-dir      Build plain rootfs
  build-lxc      Build LXC image from scratch
  build-lxd      Build LXD image from scratch
  help           Help about any command
  pack-lxc       Create LXC image from existing rootfs
  pack-lxd       Create LXD image from existing rootfs
  repack-windows Repack Windows ISO with drivers included

Flags:
      --cache-dir         Cache directory
      --cleanup           Clean up cache directory (default true)
      --debug             Enable debug output
      --disable-overlay   Disable the use of filesystem overlays
  -h, --help              help for lxd-imagebuilder
  -o, --options           Override options (list of key=value)
  -t, --timeout           Timeout in seconds
      --version           Print version number

Use "lxd-imagebuilder [command] --help" for more information about a command.

Installing from package

lxd-imagebuilder is available from the Snap Store.

sudo snap install lxd-imagebuilder --classic

Installing from source

To compile lxd-imagebuilder from source, first install the Go programming language, and some other dependencies.

  • Debian-based:

    sudo apt update
    sudo apt install -y golang-go debootstrap rsync gpg squashfs-tools git make
    
  • ArchLinux-based:

    sudo pacman -Syu
    sudo pacman -S go debootstrap rsync gnupg squashfs-tools git make --needed
    

NOTE: Imagebuilder requires Go 1.21 or higher, if your imagebuilder doesn't have a recent enough version available, get it from upstream.

Second, download the source code of the lxd-imagebuilder repository (this repository).

mkdir -p $HOME/go/src/github.com/canonical/
cd $HOME/go/src/github.com/canonical/
git clone https://github.com/canonical/lxd-imagebuilder

Third, enter the directory with the source code of lxd-imagebuilder and run make to compile the source code. This will generate the executable program lxd-imagebuilder, and it will be located at $HOME/go/bin/lxd-imagebuilder.

cd ./lxd-imagebuilder
make

Finally, you can run lxd-imagebuilder as follows.

$HOME/go/bin/lxd-imagebuilder

You may also add the directory $HOME/go/bin/ to your $PATH so that you do not need to run the command with the full path.

How to use

See How to use lxd-imagebuilder for instructions.

Troubleshooting

See Troubleshoot lxd-imagebuilder.

About

LXD Image Builder

License:GNU Affero General Public License v3.0


Languages

Language:Go 93.2%Language:HTML 2.4%Language:Shell 1.7%Language:Python 0.9%Language:CSS 0.6%Language:JavaScript 0.6%Language:Makefile 0.4%Language:Ruby 0.2%