slim
will manufacture a VM from a Dockerfile. Slim works by building and extracting a rootfs from a Dockerfile, and packaging a corresponding kernel and initrd into a desired image.
This ends up in a real VM that can boot straight, while the utilization of very little sources—all with a pair of traces in a Dockerfile.
Featured Content Ads
add advertising hereThe exercise of slim
The next are a pair of programs that that you would be in a position to well perhaps perhaps also exercise slim to manufacture VM photos.
Construct a Ubuntu Focal Cloud Uncooked VM Image
- Present a Dockerfile
photos/ubuntu-20.04-cloud-init
FROM ubuntu: 20.04 AS kernel RUN lawful-glean replace && lawful-glean install -y linux-virtual && lawful-glean higher-organized FROM ubuntu: 20.04 # Extract the kernel, modules, and initrd COPY --from=kernel /lib/modules /lib/modules COPY --from=kernel /boot/vmlinuz-/vmlinuz COPY --from=kernel /boot/initrd.img-/initrd RUN lawful-glean replace # Wished for configuring server and constructing units. RUN lawful install cloud-init udev kmod -y # Whereas you happen to'd need so as to ssh in: RUN lawful install openssh-server sudo -y
- Extract an initrd, rootfs, and uncompressed kernel.
$ slim manufacture photos/ubuntu-20.04-cloud-init
...
$ ls -lh ~/.slim/registry/ubuntu-20.04-cloud-init
-rw-r--r-- 1 cjparnin workers 16M Jan 2 17: 37 initrd
-rw-r--r-- 1 cjparnin workers 512M Jan 2 19: 24 rootfs
-rw-------@ 1 cjparnin workers 29M Nov 5 12: 04 vmlinuz
- Present a user-records and meta-records file to customise VM.
Featured Content Ads
add advertising here$ slim cloudinit photos/ubuntu-20.04-cloud-init
...
$ ls -lh ~/.slim/registry/ubuntu-20.04-cloud-init
-rw-r--r-- 1 cjparnin workers 366Ok Jan 2 21: 19 cidata.iso
VM Operating in MAC M1 (arm64).
Originate a custom Alpine RAM handiest VM Image
- Present a Dockerfile and custom init script.
Sight photos/alpine3.12-raw.
- Construct initrd and kernel.
$ slim manufacture photos/alpine3.12-raw -f initrd
...
$ ls -lh ~/.slim/registry/alpine3.12-raw
-rw-r--r-- 1 cjparnin workers 22M Jan 2 20: 50 initrd
-rw-r--r-- 1 cjparnin workers 4.6M Dec 28 11: 22 vmlinuz
Originate a Hyper-V VHD Image (Home windows)
The next creates a Ubuntu Focal with cloud-init, however the principal hyper-v kernel modules,
and bootable image for Microsoft’s Hyper-V.
Featured Content Ads
add advertising here- Present a Dockerfile.
Sight photos/ubuntu-20.04-ci-hyperv.
- Originate a VHD disk power (1G) with EFI bootable partition.
PS slim manufacture photos/ubuntu-20.04-ci-hyperv -f vhd -s 1024
...
PS ls ~/.slim/registry/ubuntu-20.04-ci-hyperv
-a---- 1/2/2022 3: 19 PM 738381824 rootfs.vhd
- Present a user-records and meta-records file to customise VM.
$ slim cloudinit photos/ubuntu-20.04-ci-hyperv
...
$ ls -lh ~/.slim/registry/ubuntu-20.04-ci-hyperv
-a---- 1/1/2022 3: 32 PM 374784 cidata.iso
Placing in slim
Simply clone this repo, cd slim, and bustle:
npm install
npm hyperlink
# Pull docker photos frail for gadget dependencies.
slim init
You salvage to salvage docker to your gadget.