build icon indicating copy to clipboard operation
build copied to clipboard

squash: add implementation

Open cgonyeo opened this issue 10 years ago • 6 comments

A new command, squash, should be added to support squashing together the given ACI with its dependencies.

acbuild begin
acbuild dep add quay.io/coreos/alpine-sh
acbuild squash

would be equivalent to

acbuild begin ./alpine-sh

cgonyeo avatar Oct 07 '15 00:10 cgonyeo

This would allow a user without support for overlayfs to work with ACIs that have dependencies (albeit losing the layers).

cgonyeo avatar Oct 07 '15 00:10 cgonyeo

I have just started looking at rocket (plenty of background using docker though), and so far I like what I see.

I am interested in this to be able to run rocket in the kernel shipped by chromeos, which would require this feature (no overlayfs).

I would be happy to contribute this feature, but I am not sure what exactly would it entail. I am not even sure if this means squashing two images together, or something else entirely. If it indeed is just merging two aci's together then the steps would be:

  • untar and uncompress all layers
  • merge the two rootfs: this could be done easily by rsync, but presumably we will have to traverse and copy by hand to avoid extraneous dependencies.
  • merge manifests, or perhaps just pick one of them? Doesn't really make sense... so maybe merging two aci's is not what squash is supposed to do?
  • recompute image id
  • tar and compress result

acornejo avatar Feb 13 '17 01:02 acornejo

Not to discourage you from contributing, but you can pass the --no-overlay flag to rkt to stop it from using overlayfs (things just might take longer as it'll need to do a little more work).

cgonyeo avatar Feb 13 '17 23:02 cgonyeo

I tried that and it does not work.

I think I am running into problems even earlier, acbuild simply ignores all my run commands. I'll post a minimal example here in a second.

acornejo avatar Feb 14 '17 04:02 acornejo

Here is what i've tried:

acbuild begin
acbuild set-name example.com/test
acbuild dep add tklx.org/base:0.1.1
acbuild run --engine chroot -- 'apt-get update && apt-get -y install vim && apt-clean --aggressive'
acbuild set-exec /bin/bash 
acbuild write --overwrite test-latest-linux-amd64.aci
acbuild end

building in a system without overlayfs support seems to completly ignore the "acbuild run" command.

acornejo avatar Feb 18 '17 07:02 acornejo

acbuild is supposed to check for overlayfs support and fail if it doesn't exist. Perhaps this check broke at some point. Would you be able to share the output that happens when you run your example?

Remove the quotes from your example, acbuild will receive the entire string as one argument and attempt to find a binary (including spaces) named apt-get update && ...

Also if your goal here is "run rocket in the kernel shipped by chromeos", then perhaps you could build images via acbuild on a machine with overlayfs, and run them on your chromeos kernel via rkt with the --no-overlay flag?

cgonyeo avatar Feb 22 '17 15:02 cgonyeo