Closed Artistan closed 6 years ago
looks like it fails in bento/_common/minimize.sh @ line 31
/sbin/swapoff "$swappart";
There is a lot happening in the post-install script and I'd bet that's related to why this isn't working. I can try to reproduce this but accounting for your particular install script is a bit outside the scope of the boxes we try to provide here but we could potentially allow a switch for not running - what you'd do here is either fork bento as is or do your configuration on top of the base image with Vagrant/config mgmt as splitting the difference is going to be difficult for us to support.
yes, definitely doing additional work outside of the scope of bento. I do believe that my question is relevant to the box build due to it failing on the swapoff portion of minimize. The scripts are installing a large amount of additional programs but that should not cause issues with minimizing the box. It is failing on memory, when trying to clear memory :)
https://community.nethserver.org/t/flushing-the-swap/3247
sync; echo 3 > /proc/sys/vm/drop_caches
I can try this in the minimize script and let you know.
I ended up increasing disk space to temporarily resolve the issue.
Increasing the disk space of the built image or of the host machine?
It's not just the additional programs, it's that they're running or otherwise started which mean memory is being held onto which is not something we really account for in the default flow. In theory we could move when the command is run but this would only move the problem around.
in the json for the build
"variables": {
...
"disk_size": "50000",
...
}
This bump to disk size https://github.com/chef/bento/pull/959 should take care of this in any case.
Looks like we have a swap memory error when finalizing the box.
packer --version 1.1.3
vagrant -v Vagrant 2.0.1
virtualbox Version 5.2.2 r119230 (Qt5.6.3)
build.txt
I added a bit more so all the minimize.sh data is here...
virtualbox configuration
this is the ubuntu-16.04-amd64 with additional scripts for adding some packages.
Additional scripts
homestead.sh
powerline.sh
elastic.sh