Both dynamic-link and no-build targets generate unnecessarily large IOC images due to the trivial COPY done from /opt. Clean up everything from there and /usr/local directory before doing the COPY to the IOC image.
Clean up strategy proposed here is the following:
Remove entirely any module that does not have a shared library linked against binaries under the IOC target directories (i.e. /opt/$REPONAME or $RUNDIR);
Prune directories from used modules and EPICS base not containing shared libraries, EPICS databases or autosave requirement files;
Remove any shared library not linked against binaries under IOC target directories;
Remove all statically linked libraries;
For pruning module directories, another approach that could be followed is to delegate this responsibility to install_module. This way, we can have contextualized pruning for modules. On the other hand, this cannot be as aggressive as implemented in this proposal, as build-dependent files (the ones defining the build-system itself, for instance) must exist until the IOC build is complete.
I have tested this with ad-aravis-epics-ioc, and it shrinks the image size from 1.33GB down to 322MB.
This should be further tested and extensively reviewed, so that no artifact is removed unexpectedly.
I'm waiting for #57 to be merged to rebase it. As of now, this would mean another step is introduced which removes all IOCs installed in the base image.
Both
dynamic-link
andno-build
targets generate unnecessarily large IOC images due to the trivialCOPY
done from/opt
. Clean up everything from there and/usr/local
directory before doing theCOPY
to the IOC image.Clean up strategy proposed here is the following:
/opt/$REPONAME
or$RUNDIR
);For pruning module directories, another approach that could be followed is to delegate this responsibility to
install_module
. This way, we can have contextualized pruning for modules. On the other hand, this cannot be as aggressive as implemented in this proposal, as build-dependent files (the ones defining the build-system itself, for instance) must exist until the IOC build is complete.I have tested this with ad-aravis-epics-ioc, and it shrinks the image size from 1.33GB down to 322MB.
This should be further tested and extensively reviewed, so that no artifact is removed unexpectedly.