# \[RFC\] Proposal: Automated Container Optimization and Image Footprint Reduction for MOSIP 1.3.x+

**URL:** <https://community.mosip.io/t/rfc-proposal-automated-container-optimization-and-image-footprint-reduction-for-mosip-1-3-x/2957>\
**Category:** General\
**Created:** [November 4, 2026, 10:15am UTC](https://community.mosip.io/t/rfc-proposal-automated-container-optimization-and-image-footprint-reduction-for-mosip-1-3-x/2957 "2026-11-04T10:15:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sankar\_Ganesh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/sankar_ganesh/32/2144_2.png) [@Sankar\_Ganesh](https://community.mosip.io/u/Sankar_Ganesh)\
**Post date:** [November 4, 2026, 10:15am UTC](https://community.mosip.io/t/rfc-proposal-automated-container-optimization-and-image-footprint-reduction-for-mosip-1-3-x/2957/1 "2026-11-04T10:15:10Z")

</div>

### Summary

A spot check of the `mosipid` namespace on Docker Hub reveals significant image footprint growth in 1.3.x releases compared to 1.2.x predecessors. For instance, `artifactory-server` reaches ~1.78 GB and `authentication-service` (v1.3.0) reaches ~1.19 GB compressed—roughly double earlier releases.

This proposal outlines an automated, policy-driven pipeline to audit container images, profile runtime dependencies, eliminate redundant layer creation, and reduce unpacked image sizes by a targeted **60% to 70%**.

### Key Operational Targets

- **Pod Startup & Autoscaling:** Reduce heavy container startup delays during traffic spikes, targeting pod startup from 3–5 minutes down to **under 60 seconds**.

- **Kubernetes Storage Efficiency:** Lower local node-cache storage pressure across Dev, QA, Pre-Prod, and Production clusters where layer caching multiplies disk consumption.

- **Vulnerability Surface Reduction:** Shrink the CVE exposure surface by systematically pruning unused OS packages, build toolchains, and interactive shells.

- **Patching Toil Reduction:** Streamline ongoing CVE remediation and engineering triage hours through cleaner base image families and shared build workflows.

### Proposed Architecture & Workflow

We propose integrating a 6-stage validation pipeline into MOSIP’s shared build workflows (`mosip/kattu`):

1. **Discover:** Automated registry scanning and size audits with exact digest and tag recording.

2. **Trace:** Profiling runtime system calls and classloader paths under load probes.

3. **Slim:** Stripping unneeded build tools, package caches, and redundant shells.

4. **Scan:** Comparing CVE surfaces before and after optimization using consistent scanners (e.g., Trivy, Grype).

5. **Validate:** Automated functional verification leveraging Spring Boot Actuator (`/actuator/health`) and MOSIP’s existing test suites (`mosip/test-management`, `mosip/mosip-functional-tests`).

6. **Promote:** Environment-gated deployments managed via Helm charts (`mosip/mosip-helm`) and install scripts (`mosip/mosip-infra`).

### Proposed Pilot Scope & Initial Targets

To minimize risk, we propose a staged rollout starting with non-transactional and job-based components:

1. **First Pilot (`admin-ui`):**

2. **Second Pilot (Spring Boot `chown` Layer Fix):**

3. **Core Services & Content Architecture:**

### Technical Risk Mitigations

- **JVM Classloading:** Mitigate static stripping risks for Spring Boot, Apache Camel, and Vert.x by executing runtime load-probe tracing and establishing strict reflection allow-lists.

- **Compatibility Verification:** Avoid unverified claims by enforcing automated health and API functional suites in Dev and QA prior to promotion.

- **Traceability:** Record original digests, trace reports, and slimmed digests for every build to ensure seamless auditability and rollback paths.

### Request for Maintainer Feedback

We would love architectural feedback from the community and core maintainers on:

1. Whether maintainers prefer automated post-build minification or upstream lightweight base image adjustments (e.g., distroless or Alpine JRE).

2. Moving chart defaults from mutable tags (like `1.3.0`) to immutable SHA-256 digests.

3. Endorsement to proceed with a non-intrusive profiling pilot on feature branches of `mosip/kattu`, `mosip/mosip-helm`, and `mosip/mosip-infra`.

Looking forward to your thoughts and guidance!

> **[Uh oh! - \[RFC\] Proposal: Automated Container Optimization and Image Footprint...](https://github.com/orgs/mosip/discussions/14#discussion-11200352)**
>
> Summary A spot check of the mosipid namespace on Docker Hub reveals significant image footprint growth in 1.3.x releases compared to 1.2.x predecessors. For instance, artifactory-server reaches ~1....

---

<div class="post-metadata">

**Author:** ![damodar](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@damodar](https://community.mosip.io/u/damodar)\
**Post date:** [November 5, 2026, 5:29am UTC](https://community.mosip.io/t/rfc-proposal-automated-container-optimization-and-image-footprint-reduction-for-mosip-1-3-x/2957/2 "2026-11-05T05:29:21Z")

</div>

Hi @Sankar_Ganesh  
Thank you for the interest shown and proposed proposal. We will take a deep look and get back to you.

Regards,  
Damodar  
Team - MOSIP

---

<div class="post-metadata">

**Author:** ![Sankar\_Ganesh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/sankar_ganesh/32/2144_2.png) [@Sankar\_Ganesh](https://community.mosip.io/u/Sankar_Ganesh)\
**Post date:** [November 5, 2026, 6:11am UTC](https://community.mosip.io/t/rfc-proposal-automated-container-optimization-and-image-footprint-reduction-for-mosip-1-3-x/2957/3 "2026-11-05T06:11:32Z")

</div>

@damodar Thank you so much for your prompt response. Have a nice day ahead.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex017/uploads/mosip1/original/1X/f60a343830fe848c9a68e2d1cc654d0cb7fbbaf2.svg) [@system](https://community.mosip.io/u/system)\
**Post date:** [November 15, 2026, 6:12am UTC](https://community.mosip.io/t/rfc-proposal-automated-container-optimization-and-image-footprint-reduction-for-mosip-1-3-x/2957/4 "2026-11-15T06:12:25Z")

</div>

Closed on November 15, 2026, 6:12am UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
