Three containers, not five

The IMS repository was split into three images, and the five-image version that gets described more often never merged.

Telecom

The split happened twice, in two halves. CW-1974 (16 April 2025) moved the build. A 41-line root Makefile was deleted in favour of a 17-line common.mk plus a three-line Makefile per service. The root Jenkinsfile became one declaration: monorepo { projects = ["ims", "dns", "mysql"] }. Three months later the directories followed (2 July 2025) — docker/ims and files/ims collapsed into ims/, and each service picked up its own meta-dev.yml and meta-prod.yml pair.

The split that never happened

A branch opened in March 2025 (CW-2157) went further. Five Dockerfiles, one each for I-CSCF, P-CSCF, S-CSCF, DNS and MySQL, all over a shared kamailio-build.Dockerfile. A build-monolith target stayed behind for compatibility. It is still a branch (four commits, none of them on main). All three CSCFs run in the ims container to this day, as three s6 services (/etc/services.d/kamailio-pcscf/run, and two siblings).

They stayed together because they share what makes a container expensive: one Kamailio build (24 modules, compiled from source), one MySQL connection, one set of config templates. The boundary that 3GPP draws between P, I and S is a protocol boundary, not a packaging one. What the team did instead is more interesting than the split would have been — a WHICH_CSCF variable that takes any subset of the letters PSI, so one image runs as a P-CSCF, as an S-CSCF, or as all three (empty or absent means all three). The DNS service was prepared the same way, with PCSCF_SIP_HOST, ICSCF_SIP_HOST and SCSCF_SIP_HOST replacing a single IMS_IP, all three initially pointing at the same address.

Three lines per service

common.mk is the whole of the shared build:

REGISTRY=registry.internal/jenkins
DEV_REGISTRY=registry.internal/playground

build:
    docker buildx build -t "${REGISTRY}/${IMAGE}:red" ${DOCKER_BUILD_ARGS} .

push:
    docker tag "${REGISTRY}/${IMAGE}:red" "${DEV_REGISTRY}/${IMAGE}:red"
    docker push "${DEV_REGISTRY}/${IMAGE}:red"

There is a third target, validate-metadata, which POSTs both meta files to a validation service (meta-dev.yml and meta-prod.yml, as multipart form fields). It is also the only check in the repository. The root Makefile's test target is @echo 'No test', and each service's Jenkinsfile carried skipcistages = [ "test" ] to say so out loud. Worth writing down plainly: three images, three metadata pairs, no tests.

The addresses are fixed on purpose

Compose puts the services on one bridge (172.22.0.0/16) and gives each a static address — MySQL at .2, DNS at .3, IMS at .4. That is deliberate, and it is the opposite of service discovery. CONTAINER_IP is substituted into the Kamailio configs by envtpl when the container starts, so the proxy binds a literal address; the DNS container answers 3GPP realm names, not container names.

MySQL gets the one piece of real orchestration. The image is mysql:8.0 plus init scripts and a my.cnf, with a HEALTHCHECK on mysqladmin ping (5s interval, 10 retries), and compose gates the IMS container on condition: service_healthy. The IMS container polls SELECT 1 in a loop anyway before importing schemas, because the production deployment has no compose file behind it and no healthcheck either. Its data sits on the host, outside the container, at /data/wireless-mysql-ims.

What the monorepo actually bought

One thing, and it is enough. A change to a Kamailio route file and a change to the DNS zone it resolves against go in one commit (one review, one merge); the per-directory path filter then builds only the images that commit touched. Everything else about the layout — three Makefiles, three Jenkinsfiles, six metadata files — is overhead paid for that.