Closed melato closed 10 months ago
I ran into a problem of shifted uids: The image has unshifted uids/gids (root is 0). But I need to copy the shifted ids (root is 1000000) in the device directory.
One way around the shifted ids problem is to shift them up. Add an "lxops shiftids" command that would shift the uid,gid of all files in a directory, recursively. Call it with sudo, so it can change file ownerehips. I am calling rsync anyway, calling another program to shift the ids is not a lot more overhead. It would be nice if rsync had an option to shift ids.
Implemented "extract" command that extracts disk devices from an image. It would be nice to include this functionality in the "launch" command.
Add a command to copy files from the root filesystem of an image to device directories.
For example:
This would:
Even better, instead of adding a new command, incorporate this functionality in the launch command:
When it needs to create a disk device directory, launch could extract it from the image, instead of creating an empty one.
Rationale
Let's say I want to build an nginx container that has /var/log/ in an external disk device. When I build the corresponding image, until now, I've been building the image with /var/log/ in an external disk device too. The resulting image has an empty /var/log/ directory. The container depends on it being provided externally.
I would like to build the image with the nginx packages and files without any external disk devices. I can then use this image to extract the devices that I want to use as templates for my containers. That way the image has all the files that it was built with, and I can use it with different disk devices.
Implementation for launch