From bf2687a211823be540d3ab39301f48279abd22f6 Mon Sep 17 00:00:00 2001 From: Adphi Date: Wed, 15 Feb 2023 11:06:52 +0100 Subject: [PATCH] docs: add container disk support Signed-off-by: Adphi --- Makefile | 2 +- README.md | 24 +++++++++++++------ docs/content/reference/d2vm.md | 2 +- docs/content/reference/d2vm_build.md | 6 +++-- docs/content/reference/d2vm_completion.md | 2 +- .../content/reference/d2vm_completion_bash.md | 2 +- .../content/reference/d2vm_completion_fish.md | 2 +- .../reference/d2vm_completion_powershell.md | 2 +- docs/content/reference/d2vm_completion_zsh.md | 2 +- docs/content/reference/d2vm_convert.md | 6 +++-- docs/content/reference/d2vm_run.md | 2 +- docs/content/reference/d2vm_run_hetzner.md | 2 +- docs/content/reference/d2vm_run_qemu.md | 2 +- docs/content/reference/d2vm_run_vbox.md | 2 +- docs/content/reference/d2vm_version.md | 2 +- 15 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 1e9b70b..09ba957 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ tests: docs-up-to-date: @$(MAKE) cli-docs - @git diff --quiet -- docs ':(exclude)docs/content/reference/d2vm_run_qemu.md' || (git --no-pager diff -- docs ':(exclude)docs/content/reference/d2vm_run_qemu.md'; echo "Please regenerate the documentation with 'make docs'"; exit 1) + @git diff --quiet -- docs ':(exclude)docs/content/reference/d2vm_run_qemu.md' || (git --no-pager diff -- docs ':(exclude)docs/content/reference/d2vm_run_qemu.md'; echo "Please regenerate the documentation with 'make cli-docs'"; exit 1) check-fmt: @[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ] diff --git a/README.md b/README.md index 3ab9962..52ee446 100644 --- a/README.md +++ b/README.md @@ -154,20 +154,21 @@ Usage: Flags: --append-to-cmdline string Extra kernel cmdline arguments to append to the generated one - -f, --force Override output qcow2 image + --force Override output qcow2 image -h, --help help for convert --network-manager string Network manager to use for the image: none, netplan, ifupdown -o, --output string The output image, the extension determine the image format, raw will be used if none. Supported formats: qcow2 qed raw vdi vhd vmdk (default "disk0.qcow2") - -p, --password string The Root user password (default "root") + -p, --password string Optional root user password --pull Always pull docker image + --push Push the container disk image to the registry --raw Just convert the container to virtual machine image without installing anything more -s, --size string The output image size (default "10G") + -t, --tag string Container disk Docker image tag Global Flags: - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output - ``` Create an image based on the **ubuntu** official image: @@ -306,16 +307,18 @@ Flags: --append-to-cmdline string Extra kernel cmdline arguments to append to the generated one --build-arg stringArray Set build-time variables -f, --file string Name of the Dockerfile - --force Override output image + --force Override output qcow2 image -h, --help help for build --network-manager string Network manager to use for the image: none, netplan, ifupdown -o, --output string The output image, the extension determine the image format, raw will be used if none. Supported formats: qcow2 qed raw vdi vhd vmdk (default "disk0.qcow2") - -p, --password string Root user password (default "root") + -p, --password string Optional root user password + --push Push the container disk image to the registry --raw Just convert the container to virtual machine image without installing anything more -s, --size string The output image size (default "10G") + -t, --tag string Container disk Docker image tag Global Flags: - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` @@ -330,6 +333,13 @@ Or if you want to create a VirtualBox image: sudo d2vm build -p MyP4Ssw0rd -f ubuntu.Dockerfile -o ubuntu.vdi . ``` +### KubeVirt Container Disk Images + +Using the `--tag` flag with the `build` and `convert` commands, you can create a +[Container Disk Image](https://kubevirt.io/user-guide/virtual_machines/disks_and_volumes/#containerdisk) for [KubeVirt](https://kubevirt.io/). + +The `--push` flag will push the image to the registry. + ### Complete example A complete example setting up a ZSH workstation is available in the [examples/full](examples/full/README.md) directory. diff --git a/docs/content/reference/d2vm.md b/docs/content/reference/d2vm.md index 06d570b..db4d106 100644 --- a/docs/content/reference/d2vm.md +++ b/docs/content/reference/d2vm.md @@ -6,7 +6,7 @@ ``` -h, --help help for d2vm - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_build.md b/docs/content/reference/d2vm_build.md index 4601a34..0a274f2 100644 --- a/docs/content/reference/d2vm_build.md +++ b/docs/content/reference/d2vm_build.md @@ -12,19 +12,21 @@ d2vm build [context directory] [flags] --append-to-cmdline string Extra kernel cmdline arguments to append to the generated one --build-arg stringArray Set build-time variables -f, --file string Name of the Dockerfile - --force Override output image + --force Override output qcow2 image -h, --help help for build --network-manager string Network manager to use for the image: none, netplan, ifupdown -o, --output string The output image, the extension determine the image format, raw will be used if none. Supported formats: qcow2 qed raw vdi vhd vmdk (default "disk0.qcow2") -p, --password string Optional root user password + --push Push the container disk image to the registry --raw Just convert the container to virtual machine image without installing anything more -s, --size string The output image size (default "10G") + -t, --tag string Container disk Docker image tag ``` ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_completion.md b/docs/content/reference/d2vm_completion.md index c685825..9c7165b 100644 --- a/docs/content/reference/d2vm_completion.md +++ b/docs/content/reference/d2vm_completion.md @@ -17,7 +17,7 @@ See each sub-command's help for details on how to use the generated script. ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_completion_bash.md b/docs/content/reference/d2vm_completion_bash.md index a4cbb9d..a084434 100644 --- a/docs/content/reference/d2vm_completion_bash.md +++ b/docs/content/reference/d2vm_completion_bash.md @@ -40,7 +40,7 @@ d2vm completion bash ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_completion_fish.md b/docs/content/reference/d2vm_completion_fish.md index 1d0b5d4..f0b6a9c 100644 --- a/docs/content/reference/d2vm_completion_fish.md +++ b/docs/content/reference/d2vm_completion_fish.md @@ -31,7 +31,7 @@ d2vm completion fish [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_completion_powershell.md b/docs/content/reference/d2vm_completion_powershell.md index ed48126..5267029 100644 --- a/docs/content/reference/d2vm_completion_powershell.md +++ b/docs/content/reference/d2vm_completion_powershell.md @@ -28,7 +28,7 @@ d2vm completion powershell [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_completion_zsh.md b/docs/content/reference/d2vm_completion_zsh.md index 017850b..193a9c3 100644 --- a/docs/content/reference/d2vm_completion_zsh.md +++ b/docs/content/reference/d2vm_completion_zsh.md @@ -38,7 +38,7 @@ d2vm completion zsh [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_convert.md b/docs/content/reference/d2vm_convert.md index 1e0c88b..e02a726 100644 --- a/docs/content/reference/d2vm_convert.md +++ b/docs/content/reference/d2vm_convert.md @@ -10,20 +10,22 @@ d2vm convert [docker image] [flags] ``` --append-to-cmdline string Extra kernel cmdline arguments to append to the generated one - -f, --force Override output qcow2 image + --force Override output qcow2 image -h, --help help for convert --network-manager string Network manager to use for the image: none, netplan, ifupdown -o, --output string The output image, the extension determine the image format, raw will be used if none. Supported formats: qcow2 qed raw vdi vhd vmdk (default "disk0.qcow2") -p, --password string Optional root user password --pull Always pull docker image + --push Push the container disk image to the registry --raw Just convert the container to virtual machine image without installing anything more -s, --size string The output image size (default "10G") + -t, --tag string Container disk Docker image tag ``` ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_run.md b/docs/content/reference/d2vm_run.md index fb62bcc..e6888d9 100644 --- a/docs/content/reference/d2vm_run.md +++ b/docs/content/reference/d2vm_run.md @@ -11,7 +11,7 @@ Run the virtual machine image ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_run_hetzner.md b/docs/content/reference/d2vm_run_hetzner.md index fb8a8ba..4ca34ba 100644 --- a/docs/content/reference/d2vm_run_hetzner.md +++ b/docs/content/reference/d2vm_run_hetzner.md @@ -20,7 +20,7 @@ d2vm run hetzner [options] image-path [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_run_qemu.md b/docs/content/reference/d2vm_run_qemu.md index 4588f1a..f94cb62 100644 --- a/docs/content/reference/d2vm_run_qemu.md +++ b/docs/content/reference/d2vm_run_qemu.md @@ -28,7 +28,7 @@ d2vm run qemu [options] [image-path] [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_run_vbox.md b/docs/content/reference/d2vm_run_vbox.md index 95e48ea..f24656f 100644 --- a/docs/content/reference/d2vm_run_vbox.md +++ b/docs/content/reference/d2vm_run_vbox.md @@ -22,7 +22,7 @@ d2vm run vbox [options] image-path [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ``` diff --git a/docs/content/reference/d2vm_version.md b/docs/content/reference/d2vm_version.md index b6076d2..f4f9978 100644 --- a/docs/content/reference/d2vm_version.md +++ b/docs/content/reference/d2vm_version.md @@ -15,7 +15,7 @@ d2vm version [flags] ### Options inherited from parent commands ``` - -t, --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") + --time string Enable formated timed output, valide formats: 'relative (rel | r)', 'full (f)' (default "none") -v, --verbose Enable Verbose output ```