kvm icon indicating copy to clipboard operation
kvm copied to clipboard

Move image to alpine?

Open pwFoo opened this issue 9 years ago • 4 comments

Could be easy to do and reduce the image size?

Tested qemu kvm with a simple alpine container

docker run --rm -ti --name kvm --cap-add NET_ADMIN -v /path-to-my-qcow2.img:/image/image.qcow2 --device /dev/kvm:/dev/kvm alpine sh
apk -U add qemu-system-x86_64 qemu bridge-utils dnsmasq

qemu-system-x86_64 -enable-kvm -cpu host -m 1024 -curses -drive file=/image/image.qcow2,format=qcow2,cache=none -usb -usbdevice tablet

pwFoo avatar Oct 04 '16 10:10 pwFoo

Thank you for your feedback, pwFoo!

I have this in the roadmap, and I will move the image to a minimal container ASAP.

methadata avatar Oct 04 '16 16:10 methadata

Great! :)

Tested it with the followin modifications.

dockerfile

FROM    alpine:latest

ENV     container docker

RUN     apk -U --no-cache add qemu qemu-system-x86_64 bridge-utils bash dnsmasq && rm -rf /var/cache/apk/*

COPY    startvm /usr/local/bin/startvm

RUN     chmod u+x /usr/local/bin/startvm \
        && mkdir /etc/dnsmasq.d

VOLUME  /image

ENTRYPOINT ["/usr/local/bin/startvm"]
CMD []

startvm

+   -machine accel=kvm,usb=off \
-    -machine rhel6.0.0,accel=kvm,usb=off \

pwFoo avatar Oct 04 '16 17:10 pwFoo

kvm                                           latest              b7b1e0370df3        19 minutes ago      42.31 MB
bbvainnotech/kvm                              latest              3076a53caa13        2 hours ago         319.2 MB

pwFoo avatar Oct 05 '16 11:10 pwFoo

Reopened due to networking issues with Alpine container.

Master branch will still be built with Centos until everything is solved. After that, Alpine branch will be merged.

Some debug info for future investigation:

  • Centos container: QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-105.el7_2.7)
  • Alpine container: QEMU emulator version 2.5.1

methadata avatar Oct 07 '16 11:10 methadata