windows icon indicating copy to clipboard operation
windows copied to clipboard

[Feature]: Use only container instead external storage (volume or host mapping)

Open Krzysztof318 opened this issue 1 year ago • 8 comments

Is your proposal related to a problem?

Currently each container uses docker volumes or we can optionally map it to host path.

Describe the solution you'd like.

Allowing disable external storage and store all windows files with container. Of course it will cause containers will very big, but then we can easly use docker commit to create container image as checkpoint purpose. Currently for using this for testing software is a bit inconvenient because everytime I create new fresh container for testing it reinstall whole system. If I can create custom container image after installation with docket commit it should be much faster to create new fresh containers for software testing.

Describe alternatives you've considered.

Manually backup docker volumes.

Additional context

No response

Krzysztof318 avatar Nov 12 '24 22:11 Krzysztof318

Very good idea, I will add this to the next version!

kroese avatar Nov 12 '24 23:11 kroese

This now added in v4.03 if you set:

environment:
  COMMIT: "Y"

Try it out and let me know if it works!

kroese avatar Nov 13 '24 11:11 kroese

@Krzysztof318 That is because the container is based on qemu-docker, you can see the relevant changes here: https://github.com/qemus/qemu-docker/commit/549789337cecec5964c7ffc336311519892ec0d0

kroese avatar Nov 13 '24 16:11 kroese

It works but commiting with docker is almost impossible, hangs on commit command, anyway your patch works, just docker has a problem with commit huge image about 64gb.

@Edit Creating image took 15 minutes

Krzysztof318 avatar Nov 13 '24 16:11 Krzysztof318

@kroese Could you also disable creating empty volume and remove iso file after installation?

Krzysztof318 avatar Nov 13 '24 16:11 Krzysztof318

I am not docker and linux speciallist but image from container shouldn't be smaller? data.img is growable disk so, why it takes full size when docker commit?

Krzysztof318 avatar Nov 13 '24 16:11 Krzysztof318

@Krzysztof318, I've set COMMIT=Y and DISK_FMT=qcow2 environment variables. It creates growable qcow2 disk image instead of raw sparse file. I was able to commit my container and reuse it later multiple times. Commit took 3 minutes.

kildom avatar Dec 04 '24 18:12 kildom

Something like this will be also fine for docker image layers qemu support disk snapshots https://kashyapc.fedorapeople.org/virt/lc-2012/snapshots-handout.html

xlazom00 avatar Dec 06 '24 12:12 xlazom00

Implemented

Krzysztof318 avatar Dec 15 '24 18:12 Krzysztof318