Hey, so I am using FPCUp to build FPC+Crosscompilers and Lazarus for a docker image. Now it works pretty well, but I run into another problem, the installation gets huge:
root@4907722d13a2:/# du -hs root/development/*
68K root/development/config_lazarus
827M root/development/fpc
3.2M root/development/fpcbootstrap
969M root/development/lazarus
4.0K root/development/projects
This is just after the base installation without any cross compilers and it already takes up 1.8 GB. With the cross compilers for Win32 and Win64, another 400mb is added, resulting in a stagaring 3GB Docker image.
There must be a way to reduce that size. When I download the OpenSuse RPM package for Lazarus and FPC they are in sum around 100 mb large, so I'm off by a factor of 18.
That said, I don't even need complete lazarus, I only need the LCL and lazbuild, but I am to stupid to find out how to tell fpcup this.
Another thing I thought is, after compiling there sure are compilation artifacts I don't need anymore, as well as the the (fpc) source, is also unessecary (as it is for docker, I don't need lazarus completion feature and stuff so I don't need these sources).
Does anyone of you know how I can clean up the Lazbuild installation, and/or minimize it?
This is the script that installs Lazarus and FPC, pretty naive and uses only very few arguments for FPCUp
function build() {
fpcup --noconfirm --fpcURL=$FPC --lazURL=$LAZ $@
}
function buildCross() {
cpu="$1"
shift
os="$1"
shift
build --only=FPCBuildOnly --cputarget=$cpu --ostarget=$os $@
}
# Install fpc and lazars for linux x86_64
build
# Install cross-compiler for Win32
buildCross i386 win32
# Install cross-compiler for win64
buildCross x86_64 win64