subuser icon indicating copy to clipboard operation
subuser copied to clipboard

ENHANCMENT: save compressed subuser images

Open peter1000 opened this issue 11 years ago • 13 comments

Before starting with subuser a couple of days ago I looked into saving compressed docker images to file.

Because I like to be as much as possible internet independent (or if one uses subuser with a slower connection on a mobile ect.. or download limit) I will add the option to save subuser program images to file.

build once transfer and install multiple times.

peter1000 avatar Feb 17 '14 14:02 peter1000

This is a good idea. I think, going off the example of git, we could call it subuser bundle...

timthelion avatar Feb 17 '14 15:02 timthelion

Not sure if that would be the best for what I had in mind.

Anyway, I implemented the first part of it to save to file: but will only send a pullrequest after the make image is merged.

at the moment I live in Southamerica so I do not want to be always dependent on the internet even though it works mostly fine

So my idea would be:

Additional folder: savedCompressedProgramImages

subuser save-compressed-image firefox saves to 'subuser/savedCompressedProgramImages/firefox.tar.xz

The compression is quite ok: the new libubuntu_precise has 172.2 MB and compresses to a saved one of 36 MB

This I already finished

peter1000 avatar Feb 17 '14 15:02 peter1000

The second part I will do is a simple: command: install-compressed-image

the third part would be to integrate it into the normal subuser install procedure maybe with an option like

subuser install firefox --allow-saveimage or something like that

Than it should first check if for any required dependency a saved image is available: this should work from top->bottom of dependencies because if a saved image for x11 is ready we do not need the lower dependent once

Just an idea?

peter1000 avatar Feb 17 '14 15:02 peter1000

maybe the list argument could also have an option subuser list savedimage

peter1000 avatar Feb 17 '14 15:02 peter1000

the example: firefox_libx11_libubuntu_precise 373.2 MB compressed to 92 MB

Anyway if we want we could add a compression level option: xz uses default level 6 of 9

peter1000 avatar Feb 17 '14 16:02 peter1000

compression level 9 did reduce a test image another 10+%

libubuntu_precise compression6.tar.xz 36.2MB libubuntu_precise compression9.tar.xz 31.9MB

peter1000 avatar Feb 17 '14 18:02 peter1000

I will work on going over all your comments tomorrow. It's 1 am here, and I want to think this through properly...

timthelion avatar Feb 17 '14 23:02 timthelion

see explanation: https://github.com/subuser-security/subuser/commit/47e364714f51b6c8dd40e5e8b58bfe2cb10aa08e#commitcomment-5405340

peter1000 avatar Feb 18 '14 09:02 peter1000

It just occured to me, that putting the image-id into the filename won't work on Windows due to the 255 character long path restriction.

timthelion avatar Feb 20 '14 11:02 timthelion

I think that we shouldn't worry about that though. Some advanced features may not be supported on outdated operating systems ;)

timthelion avatar Feb 20 '14 11:02 timthelion

Do you want an image file and a extra jsonlike

firefox-image.tar.xz
firefox-image.json

firefox-image.json has the output of inspect

peter1000 avatar Feb 20 '14 11:02 peter1000

That would be fine. But don't put the program name in the name of the files. It is simpler to progam if the names are standard.

timthelion avatar Feb 20 '14 11:02 timthelion

hi, in the next couple of days I want have time for this.

peter1000 avatar Feb 24 '14 09:02 peter1000