mirror of
https://github.com/linka-cloud/d2vm.git
synced 2024-12-01 20:06:25 +00:00
1 line
52 KiB
JSON
1 line
52 KiB
JSON
|
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"d2vm (Docker to Virtual Machine) Build virtual machine image from Docker images The project is heavily inspired by the article and the work done by iximiuz on docker-to-linux . Many thanks to him. Status : alpha Supported Environments: Only building Linux Virtual Machine images is supported. Starting from v0.1.0, d2vm automatically run build and convert commands inside Docker when not running on linux or when running without root privileges. Note: windows should be working, but is totally untested. Supported VM Linux distributions: Working and tested: Ubuntu (18.04+) Luks support is available only on Ubuntu 20.04+ Debian (stretch+) Luks support is available only on Debian buster+ Alpine CentOS (8+) Unsupported: RHEL The program uses the /etc/os-release file to discover the Linux distribution and install the Kernel, if the file is missing, the build cannot succeed. Obviously, Distroless images are not supported. Prerequisites osx Docker QEMU (optional) VirtualBox (optional) Linux Docker util-linux udev parted e2fsprogs mount tar extlinux qemu-utils cryptsetup (when using LUKS) QEMU (optional) VirtualBox (optional) Getting started Install With Docker Note: this will only work if both the source context (and Dockerfile) and the output directory are somewhere inside the directory where you run the command. docker pull linkacloud/d2vm:latest alias d2vm = \"docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v \\$PWD:/d2vm -w /d2vm linkacloud/d2vm:latest\" wich d2vm d2vm: aliased to docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v $PWD :/d2vm -w /d2vm linkacloud/d2vm:latest With Homebrew brew install linka-cloud/tap/d2vm From release Download the latest release for your platform from the release page . Extract the tarball, then move the extracted d2vm binary to somewhere in your $PATH ( /usr/local/bin for most users). VERSION = $( git ls-remote --tags https://github.com/linka-cloud/d2vm | cut -d '/' -f 3 | tail -n 1 ) OS = $( uname -s | tr '[:upper:]' '[:lower:]' ) ARCH = $( [ \" $( uname -m ) \" = \"x86_64\" ] && echo \"amd64\" || echo \"arm64\" ) curl -sL \"https://github.com/linka-cloud/d2vm/releases/download/ ${ VERSION } /d2vm_ ${ VERSION } _ ${ OS } _ ${ ARCH } .tar.gz\" | tar -xvz d2vm sudo mv d2vm /usr/local/bin/ From source Clone the git repository: git clone https://github.com/linka-cloud/d2vm && cd d2vm Install using the make , docker and the Go tool chain: make install The d2vm binary is installed in the $GOBIN directory. which d2vm /go/bin/d2vm Generate shell completion The d2vm program supports shell completion for bash , zsh and fish . It can be enabled by running the following command: source < ( d2vm completion $( basename $SHELL ) ) Or you can install the completion file in the shell completion directory by following the instructions: d2vm completion $( basename $SHELL ) --help Converting an existing Docker Image to VM image: d2vm convert --help Convert Docker image to vm image Usage: d2vm convert [docker image] [flags] Flags: --append-to-cmdline string Extra kernel cmdline arguments to append to the generated one --boot-size uint Size of the boot partition in MB (default 100) --force Override output qcow2 image -h, --help help for convert --keep-cache Keep the images after the build --luks-password string Password to use for the LUKS encrypted root partition. If not set, the root partition will not be encrypted --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 stri
|