sergey-safarov created an issue (kamailio/kamailio#4241)
### Description
In the GitHub Actions present Alpine Docker image build error ``` tar (child): kamailio_min-without_os_files.tar.gz: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now ``` https://github.com/kamailio/kamailio/actions/runs/14722992691/job/4132011103...
With high probability, this does not work
I will work to fix this, but if possible, it will be fine to switch to use `cmake` for Alpine Docker image.
sergey-safarov left a comment (kamailio/kamailio#4241)
@xkaraman could help write `cmake` rules to replace this bash script https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh
xkaraman left a comment (kamailio/kamailio#4241)
@sergey-safarov Sure i can help you out? What does this script does exactly?
sergey-safarov left a comment (kamailio/kamailio#4241)
**build_and_install** - build Kamailio sources, package, and install https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L12C1-L2...
**list_installed_kamailio_packages** - list installed packages and filter by kamailio string. This output installed the kamailio packages. https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L27-L36
**kamailio_files()** - list the content of the kamailio packages and some mandatory packages. https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L27-L36
**extra_files()** - list of mandatory files for Alpine-based Kamailio docker image. https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L38-L58
**sort_filelist**—after merging the `ldd` output, some files may be listed several times. function make filelist deduplication https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L60-L63
**filter_unnecessary_files()** - exclude debug, man, docs and redme files from packaging into the docker image https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L65-L78
**ldd_helper()** - functions to call `ldd` and parse output. For `Kamailio` modules required preload Kamailio binary file. https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L80C1-L8...
**find_binaries** - we package binary files only. `ldd` is used to test file is binary or not. This function also dynamically linked files https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L87C1-L1...
**filter_os_files** - exclude files present in the base Alpine Docker image. Required to avoid unnecessary file copy to the layer. https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L87C1-L1...
**tar_files** - create two tar archives. First contains all the files required for `minimal` Docker images. The second tar archive contains files required to add to the base Alpine image. Probably here kamailio binary files are listed twice in the `$TARLIST`. https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L118-L13...
**make_image_tar** - create a minimal image tree and add busybox to the tree. After this package tar again https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L135-L14...
**create_apk_dir** - copy the kamailio packages to the mounted folder. These files will be present on the host when docker container is terminated https://github.com/kamailio/kamailio-ci/blob/master/alpine/build.sh#L143-L14...