First : Very good job!
Second : Please excuse my english ^^
I've just an issue : At the first start, the qcow2 file is empty, so the qemu will try to create the file instead of just read/write the volume mapped. And a container can't create a new file over a mapped file. So we must start for the first time without the -v of qcow2 file and without "--rm" option, perform the container setup, exit the container, copy the qcow2 file with "docker copy [id]:/tmp/hda.qcow2 ." and after restart another container without cdrom and with the volume qcow2 mapped.
And it's works like a charm! Now i will try to use my qcow2 file into my jenkins stack to build my containers images without any privilege. I know that without --device the container is very slow, but maybe with an alpine+docker only to build very simple Dockerfiles (get image base, copy binaries files and push to my own registry) is acceptable.
If it's okay you will my savior ^^
Honestly, I usually mount the whole folder instead of a single file, since I often have other files my VM needs (install ISO, floppy disk with QEMU drivers for Windows, kernel+initramfs for arm VMs, etc). 😅
First : Very good job! Second : Please excuse my english ^^
I've just an issue : At the first start, the qcow2 file is empty, so the qemu will try to create the file instead of just read/write the volume mapped. And a container can't create a new file over a mapped file. So we must start for the first time without the -v of qcow2 file and without "--rm" option, perform the container setup, exit the container, copy the qcow2 file with "docker copy [id]:/tmp/hda.qcow2 ." and after restart another container without cdrom and with the volume qcow2 mapped.
And it's works like a charm! Now i will try to use my qcow2 file into my jenkins stack to build my containers images without any privilege. I know that without --device the container is very slow, but maybe with an alpine+docker only to build very simple Dockerfiles (get image base, copy binaries files and push to my own registry) is acceptable. If it's okay you will my savior ^^