mirror of
https://github.com/linka-cloud/d2vm.git
synced 2026-01-25 19:15:04 +00:00
Compare commits
13 Commits
v0.1.0-rc2
...
v0.1.0-rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
fb5f21f1f3
|
|||
|
8f1ae3a8a4
|
|||
|
a6163db5b8
|
|||
|
9d2ceb8cba
|
|||
|
3940cd8975
|
|||
|
7ad6343e6f
|
|||
|
2cd50ff38c
|
|||
|
f855fe9c7a
|
|||
|
f1557d104d
|
|||
|
7f3b3a859d
|
|||
|
7718c533eb
|
|||
|
0208a2a134
|
|||
|
238d9a51af
|
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
${{ runner.os }}-tests-
|
||||
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
run: git --no-pager diff --exit-code HEAD~1 HEAD **/**.go templates/ || make tests
|
||||
|
||||
docs-up-to-date:
|
||||
name: Docs up to date
|
||||
|
||||
4
.github/workflows/docs.yaml
vendored
4
.github/workflows/docs.yaml
vendored
@@ -1,9 +1,7 @@
|
||||
name: Docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- docs
|
||||
- main
|
||||
tags: [ "v*" ]
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -13,3 +13,5 @@ images
|
||||
.goreleaser.yaml
|
||||
docs/build
|
||||
docs-src
|
||||
/completions
|
||||
/cmd/d2vm/run/sparsecat-linux-amd64
|
||||
|
||||
@@ -15,6 +15,8 @@ project_name: d2vm
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- go generate ./...
|
||||
- make completions
|
||||
builds:
|
||||
- main: ./cmd/d2vm
|
||||
env:
|
||||
@@ -37,6 +39,35 @@ snapshot:
|
||||
name_template: "{{ .Env.VERSION }}"
|
||||
release:
|
||||
prerelease: auto
|
||||
extra_files:
|
||||
- glob: LICENCE
|
||||
- glob: pgp.pub
|
||||
archives:
|
||||
- name_template: '{{ .ProjectName }}_{{ .Env.VERSION }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
|
||||
files:
|
||||
- LICENCE
|
||||
- README.md
|
||||
- completions/*
|
||||
brews:
|
||||
- name: d2vm
|
||||
tap:
|
||||
owner: linka-cloud
|
||||
name: homebrew-tap
|
||||
folder: Formula
|
||||
homepage: https://github.com/linka-cloud/d2vm
|
||||
description: Build Virtual Machine Image from Dockerfile or Docker image
|
||||
license: Apache License 2.0
|
||||
test: |
|
||||
system "#{bin}/d2vm --version"
|
||||
dependencies:
|
||||
- name: go
|
||||
type: optional
|
||||
- name: git
|
||||
install: |-
|
||||
bin.install "d2vm"
|
||||
bash_completion.install "completions/d2vm.bash" => "d2vm"
|
||||
zsh_completion.install "completions/d2vm.zsh" => "_d2vm"
|
||||
fish_completion.install "completions/d2vm.fish"
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
|
||||
15
Makefile
15
Makefile
@@ -78,6 +78,9 @@ vet:
|
||||
|
||||
build-dev: docker-build .build
|
||||
|
||||
install: docker-build
|
||||
@go install -ldflags "-s -w -X '$(MODULE).Version=$(VERSION)' -X '$(MODULE).BuildDate=$(shell date)'" ./cmd/d2vm
|
||||
|
||||
.build:
|
||||
@go generate ./...
|
||||
@go build -o d2vm -ldflags "-s -w -X '$(MODULE).Version=$(VERSION)' -X '$(MODULE).BuildDate=$(shell date)'" ./cmd/d2vm
|
||||
@@ -98,15 +101,23 @@ build: bin
|
||||
release: bin
|
||||
@VERSION=$(VERSION) IMAGE=$(DOCKER_IMAGE) goreleaser release --rm-dist --parallelism 8
|
||||
|
||||
.PHONY: completions
|
||||
completions: .build
|
||||
@rm -rf completions
|
||||
@mkdir -p completions
|
||||
@for shell in bash zsh fish powershell; do \
|
||||
./d2vm completion $$shell > completions/d2vm.$$shell; \
|
||||
done
|
||||
|
||||
.PHONY: examples
|
||||
examples: build-dev
|
||||
@mkdir -p examples/build
|
||||
@for f in $$(find examples -type f -name '*Dockerfile' -maxdepth 1); do \
|
||||
echo "Building $$f"; \
|
||||
./d2vm build -o examples/build/$$(basename $$f|cut -d'.' -f1).qcow2 -f $$f examples; \
|
||||
./d2vm build -o examples/build/$$(basename $$f|cut -d'.' -f1).qcow2 -p root -f $$f examples --force; \
|
||||
done
|
||||
@echo "Building examples/full/Dockerfile"
|
||||
@./d2vm build -o examples/build/full.qcow2 --build-arg=USER=adphi --build-arg=PASSWORD=adphi examples/full
|
||||
@./d2vm build -o examples/build/full.qcow2 --build-arg=USER=adphi --build-arg=PASSWORD=adphi examples/full --force
|
||||
|
||||
cli-docs: .build
|
||||
@rm -rf $(CLI_REFERENCE_PATH)
|
||||
|
||||
39
README.md
39
README.md
@@ -43,7 +43,15 @@ Obviously, **Distroless** images are not supported.
|
||||
|
||||
### Install from release
|
||||
|
||||
Download the latest release for your platform from the [release page](https://github.com/linka-cloud/d2vm/releases/latest)
|
||||
Download the latest release for your platform from the [release page](https://github.com/linka-cloud/d2vm/releases/latest).
|
||||
|
||||
Extract the tarball:
|
||||
|
||||
```bash
|
||||
tar -xvzf <RELEASE-TARBALL-NAME>.tar.gz
|
||||
```
|
||||
|
||||
Move the extracted *d2vm* binary to somewhere in your `$PATH` (`/usr/local/bin` for most users).
|
||||
|
||||
### Install from source
|
||||
|
||||
@@ -56,9 +64,34 @@ git clone https://github.com/linka-cloud/d2vm && cd d2vm
|
||||
Install using the *make*, *docker* and the Go tool chain:
|
||||
|
||||
```bash
|
||||
make build-dev && sudo cp d2vm /usr/local/bin/
|
||||
make install
|
||||
```
|
||||
|
||||
The *d2vm* binary is installed in the `$GOBIN` directory.
|
||||
|
||||
```bash
|
||||
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:
|
||||
|
||||
```bash
|
||||
source <(d2vm completion $(basename $SHELL))
|
||||
```
|
||||
|
||||
Or you can install the completion file in the shell completion directory by following the instructions:
|
||||
|
||||
```bash
|
||||
d2vm completion $(basename $SHELL) --help
|
||||
```
|
||||
|
||||
|
||||
### Converting an existing Docker Image to VM image:
|
||||
|
||||
```bash
|
||||
@@ -206,8 +239,6 @@ RUN apt update && apt install -y openssh-server && \
|
||||
|
||||
```
|
||||
|
||||
When building the vm image, *d2vm* will create a root password, so there is no need to configure it now.
|
||||
|
||||
Build the vm image:
|
||||
|
||||
The *build* command take most of its flags and arguments from the *docker build* command.
|
||||
|
||||
@@ -105,6 +105,11 @@ func sysconfig(osRelease OSRelease) (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
type Builder interface {
|
||||
Build(ctx context.Context) (err error)
|
||||
Close() error
|
||||
}
|
||||
|
||||
type builder struct {
|
||||
osRelease OSRelease
|
||||
|
||||
@@ -125,7 +130,7 @@ type builder struct {
|
||||
cmdLineExtra string
|
||||
}
|
||||
|
||||
func NewBuilder(ctx context.Context, workdir, imgTag, disk string, size int64, osRelease OSRelease, format string, cmdLineExtra string) (*builder, error) {
|
||||
func NewBuilder(ctx context.Context, workdir, imgTag, disk string, size int64, osRelease OSRelease, format string, cmdLineExtra string) (Builder, error) {
|
||||
if err := checkDependencies(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ func init() {
|
||||
buildCmd.Flags().StringArrayVar(&buildArgs, "build-arg", nil, "Set build-time variables")
|
||||
|
||||
buildCmd.Flags().StringVarP(&output, "output", "o", output, "The output image, the extension determine the image format, raw will be used if none. Supported formats: "+strings.Join(d2vm.OutputFormats(), " "))
|
||||
buildCmd.Flags().StringVarP(&password, "password", "p", "root", "Root user password")
|
||||
buildCmd.Flags().StringVarP(&password, "password", "p", "", "Optional root user password")
|
||||
buildCmd.Flags().StringVarP(&size, "size", "s", "10G", "The output image size")
|
||||
buildCmd.Flags().BoolVar(&force, "force", false, "Override output image")
|
||||
buildCmd.Flags().StringVar(&cmdLineExtra, "append-to-cmdline", "", "Extra kernel cmdline arguments to append to the generated one")
|
||||
|
||||
@@ -111,7 +111,7 @@ func parseSize(s string) (int64, error) {
|
||||
func init() {
|
||||
convertCmd.Flags().BoolVar(&pull, "pull", false, "Always pull docker image")
|
||||
convertCmd.Flags().StringVarP(&output, "output", "o", output, "The output image, the extension determine the image format, raw will be used if none. Supported formats: "+strings.Join(d2vm.OutputFormats(), " "))
|
||||
convertCmd.Flags().StringVarP(&password, "password", "p", "root", "The Root user password")
|
||||
convertCmd.Flags().StringVarP(&password, "password", "p", "", "Optional root user password")
|
||||
convertCmd.Flags().StringVarP(&size, "size", "s", "10G", "The output image size")
|
||||
convertCmd.Flags().BoolVarP(&force, "force", "f", false, "Override output qcow2 image")
|
||||
convertCmd.Flags().StringVar(&cmdLineExtra, "append-to-cmdline", "", "Extra kernel cmdline arguments to append to the generated one")
|
||||
|
||||
@@ -34,7 +34,7 @@ import (
|
||||
var (
|
||||
output = "disk0.qcow2"
|
||||
size = "1G"
|
||||
password = "root"
|
||||
password = ""
|
||||
force = false
|
||||
verbose = false
|
||||
timeFormat = ""
|
||||
@@ -56,6 +56,12 @@ var (
|
||||
logrus.SetLevel(logrus.TraceLevel)
|
||||
}
|
||||
exec.SetDebug(verbose)
|
||||
|
||||
// make the zsh completion work when sourced with `source <(d2vm completion zsh)`
|
||||
if cmd.Name() == "zsh" && cmd.Parent() != nil && cmd.Parent().Name() == "completion" {
|
||||
zshHead := fmt.Sprintf("#compdef %[1]s\ncompdef _%[1]s %[1]s\n", cmd.Root().Name())
|
||||
cmd.OutOrStdout().Write([]byte(zshHead))
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -71,7 +71,7 @@ func init() {
|
||||
|
||||
// Paths and settings for disks
|
||||
flags.Var(&disks, "disk", "Disk config, may be repeated. [file=]path[,size=1G][,format=qcow2]")
|
||||
flags.StringVar(&data, "data", "", "String of metadata to pass to VM; error to specify both -data and -data-file")
|
||||
flags.StringVar(&data, "data", "", "String of metadata to pass to VM")
|
||||
|
||||
// VM configuration
|
||||
flags.StringVar(&accel, "accel", defaultAccel, "Choose acceleration mode. Use 'tcg' to disable it.")
|
||||
@@ -91,7 +91,7 @@ func init() {
|
||||
// USB devices
|
||||
flags.BoolVar(&usbEnabled, "usb", false, "Enable USB controller")
|
||||
|
||||
flags.Var(&deviceFlags, "device", "Add USB host device(s). Format driver[,prop=value][,...] -- add device, like -device on the qemu command line.")
|
||||
flags.Var(&deviceFlags, "device", "Add USB host device(s). Format driver[,prop=value][,...] -- add device, like --device on the qemu command line.")
|
||||
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -93,7 +93,7 @@ func vbox(ctx context.Context, path string) error {
|
||||
}
|
||||
|
||||
// remove machine in case it already exists
|
||||
cleanup(vboxmanage, name)
|
||||
cleanup(vboxmanage, name, false)
|
||||
|
||||
_, out, err := manage(vboxmanage, "createvm", "--name", name, "--register")
|
||||
if err != nil {
|
||||
@@ -273,22 +273,26 @@ func vbox(ctx context.Context, path string) error {
|
||||
return <-errs
|
||||
}
|
||||
|
||||
func cleanup(vboxmanage string, name string) {
|
||||
if _, _, err := manage(vboxmanage, "controlvm", name, "poweroff"); err != nil {
|
||||
func cleanup(vboxmanage string, name string, logErrs ...bool) {
|
||||
logErr := true
|
||||
if len(logErrs) > 0 {
|
||||
logErr = logErrs[0]
|
||||
}
|
||||
if _, _, err := manage(vboxmanage, "controlvm", name, "poweroff"); err != nil && logErr {
|
||||
log.Errorf("controlvm poweroff error: %v", err)
|
||||
}
|
||||
_, out, err := manage(vboxmanage, "storageattach", name, "--storagectl", "IDE Controller", "--port", "1", "--device", "0", "--type", "hdd", "--medium", "emptydrive")
|
||||
if err != nil {
|
||||
if err != nil && logErr {
|
||||
log.Errorf("storageattach error: %v\n%s", err, out)
|
||||
}
|
||||
for i := range disks {
|
||||
id := strconv.Itoa(i)
|
||||
_, out, err := manage(vboxmanage, "storageattach", name, "--storagectl", "SATA", "--port", "0", "--device", id, "--type", "hdd", "--medium", "emptydrive")
|
||||
if err != nil {
|
||||
if err != nil && logErr {
|
||||
log.Errorf("storageattach error: %v\n%s", err, out)
|
||||
}
|
||||
}
|
||||
if _, out, err = manage(vboxmanage, "unregistervm", name, "--delete"); err != nil {
|
||||
if _, out, err = manage(vboxmanage, "unregistervm", name, "--delete"); err != nil && logErr {
|
||||
log.Errorf("unregistervm error: %v\n%s", err, out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,9 +72,6 @@ func (d Dockerfile) Render(w io.Writer) error {
|
||||
}
|
||||
|
||||
func NewDockerfile(release OSRelease, img, password string, networkManager NetworkManager) (Dockerfile, error) {
|
||||
if password == "" {
|
||||
password = "root"
|
||||
}
|
||||
d := Dockerfile{Release: release, Image: img, Password: password, NetworkManager: networkManager}
|
||||
var net NetworkManager
|
||||
switch release.ID {
|
||||
|
||||
@@ -16,7 +16,7 @@ d2vm build [context directory] [flags]
|
||||
-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
|
||||
--raw Just convert the container to virtual machine image without installing anything more
|
||||
-s, --size string The output image size (default "10G")
|
||||
```
|
||||
|
||||
@@ -14,7 +14,7 @@ d2vm convert [docker image] [flags]
|
||||
-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
|
||||
--raw Just convert the container to virtual machine image without installing anything more
|
||||
-s, --size string The output image size (default "10G")
|
||||
|
||||
@@ -12,9 +12,9 @@ d2vm run qemu [options] [image-path] [flags]
|
||||
--accel string Choose acceleration mode. Use 'tcg' to disable it. (default "hvf:tcg")
|
||||
--arch string Type of architecture to use, e.g. x86_64, aarch64, s390x (default "x86_64")
|
||||
--cpus uint Number of CPUs (default 1)
|
||||
--data string String of metadata to pass to VM; error to specify both -data and -data-file
|
||||
--data string String of metadata to pass to VM
|
||||
--detached Set qemu container to run in the background
|
||||
--device multiple-flag Add USB host device(s). Format driver[,prop=value][,...] -- add device, like -device on the qemu command line. (default A multiple flag is a type of flag that can be repeated any number of times)
|
||||
--device multiple-flag Add USB host device(s). Format driver[,prop=value][,...] -- add device, like --device on the qemu command line. (default A multiple flag is a type of flag that can be repeated any number of times)
|
||||
--disk disk Disk config, may be repeated. [file=]path[,size=1G][,format=qcow2] (default [])
|
||||
--gui Set qemu to use video output instead of stdio
|
||||
-h, --help help for qemu
|
||||
|
||||
51
pgp.pub
Normal file
51
pgp.pub
Normal file
@@ -0,0 +1,51 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBGLCuWcBEADzbuC8tyB0zPmReCu0Jwvc9tJqErtaYXxizM2XGiYc6iYOheFb
|
||||
FnSFwlWK4TmtZ0XxIMMMJpIMVy1eEdbv3SBqHYXDWu+FzbEF32zfh/Sp4jzTbAZy
|
||||
eKdXdcKYShhBNBnvfdQBsKG8J5PJi37w9yX9IVfviPymz1j42w7kvPMt6KM0HC3q
|
||||
tJzwYLt6yizpY1DkT1lhypK2cgWrbBBTzxiUVHAK1Zxxr+MkSFowW5MHV0nfVWL2
|
||||
5RU9mJny98YYvUJ7cQ1WaBjDQ9LSwMi+BVfZ87ABsc6NOyxPyEq7g/qwXdWL9QVq
|
||||
bVFKvj2AaYeVJn17LYG3Ao8FfAt2tUN3FasrvmXnXumkqErwrCkGG5LFuRE11X/2
|
||||
ntSf2Ra+dp81XHmugGHKdqdridQZP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||
NRPzkTm7FGxXy2QPbDOj1/G7dvHc7fGzQimofGRIW/4/GVWRQi2pQJwKTP1KlRid
|
||||
e9oFG1+MTc6o1ZBkhz1GQbMGxeu9Na0c0DzXGMrsP6G75WSUEX+5srXuJtrxRrBy
|
||||
E3BICzn5YyWTT2cLgN3AucalL04TIqGiocvi3X/n03CXe2M2mbJFo1y1bl6M/tmR
|
||||
0fktpVlCDRs6EphMXHsKSTtO6pKPN6M0Lg50vS512xNGyc/tL2aJw/snO0vMDHSU
|
||||
JDebH4LjV1RmTRnUJxERDCfe8Jh1bsIa4u8DcVmoLyjTMXJrPNUycYIkyfp9mwAX
|
||||
LjBY2mW6Qyfp3IVdQUS1N8okIk1TiHIZC7DXdXuH7WnfEDDTV9fY91jY835y8stj
|
||||
lpX0UGjm+npt2Vyth9kIQtgUnnBl76PdjAmCHztEaL1SXiQh6h2DhdkfeVX4GUrF
|
||||
BE02K7Qy6ERZo7274WLlJOiW5EyyOKVHYrSzRLajsh8xHus270FhfcKRQG+LO8f+
|
||||
2ecvNRuNZcMiwZDUwSzUkabXk8C9F/3EOcUnHoznh/g//Z17/ZktIuJy4DLLkYIk
|
||||
jtPL12rsffEIbEo7Ok/ntyVf5rgitiHu5xSTzjG6cj0olm46rsJ0h3hij58MOw==
|
||||
=3bbH
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
@@ -12,7 +12,7 @@ RUN apk update --no-cache && \
|
||||
RUN for s in bootmisc hostname hwclock modules networking swap sysctl urandom syslog; do rc-update add $s boot; done
|
||||
RUN for s in devfs dmesg hwdrivers mdev; do rc-update add $s sysinit; done
|
||||
|
||||
RUN echo "root:{{- if .Password}}{{ .Password}}{{- else}}root{{- end}}" | chpasswd
|
||||
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
||||
|
||||
{{ if eq .NetworkManager "ifupdown"}}
|
||||
RUN apk add --no-cache ifupdown-ng
|
||||
|
||||
@@ -17,4 +17,4 @@ RUN dracut --no-hostonly --regenerate-all --force && \
|
||||
ln -s $(find . -name 'vmlinuz-*') vmlinuz && \
|
||||
ln -s $(find . -name 'initramfs-*.img') initrd.img
|
||||
|
||||
RUN echo "root:{{- if .Password}}{{ .Password}}{{- else}}root{{- end}}" | chpasswd
|
||||
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
||||
|
||||
@@ -16,7 +16,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
|
||||
RUN systemctl preset-all
|
||||
|
||||
RUN echo "root:{{- if .Password}}{{ .Password}}{{- else}}root{{- end}}" | chpasswd
|
||||
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
||||
|
||||
{{ if eq .NetworkManager "netplan" }}
|
||||
RUN apt install -y netplan.io
|
||||
|
||||
@@ -15,7 +15,7 @@ RUN apt-get update -y && \
|
||||
|
||||
RUN systemctl preset-all
|
||||
|
||||
RUN echo "root:{{- if .Password}}{{ .Password}}{{- else}}root{{- end}}" | chpasswd
|
||||
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
||||
|
||||
{{ if eq .NetworkManager "netplan" }}
|
||||
RUN apt install -y netplan.io
|
||||
|
||||
Reference in New Issue
Block a user