newsnowlabs / runcvm

RunCVM (Run Container VM) is an experimental open-source Docker container runtime, for launching standard container workloads - as well as Systemd, Docker, even OpenWrt - in VMs using 'docker run`
Apache License 2.0
72 stars 4 forks source link

Prepopulate file-backed virtual disks #15

Closed struanb closed 5 months ago

struanb commented 5 months ago

Docker's standard behavior, when launching a container with a volume mounted at path /mypath, is to copy any files at path /mypath into the volume before starting the container.

Currently when a RunCVM container/VM is launched with --env=RUNCVM_DISKS=/disks/mydisk,/mypath,ext4,1G the file-backed disk mounted at /mypath is created empty.

Reproduce the Docker standard behaviour in this case, by prepopulating /disks/mydisk with the files at /mypath.

Except in the case where the mount-path is /, this should be a really easy fix, as mke2fs offers a -d option that will prepopulate the disk image.

struanb commented 5 months ago

Closed by https://github.com/newsnowlabs/runcvm/commit/687821d323d774ea90ad1ded9e6ba17a71a7e1ee