feat: optimize Docker image size with three-image matrix - #506
Closed
cxhello wants to merge 12 commits into
Closed
Conversation
AI features (ai-pipeline, skill-scanner, anonymous AI access) are now hardcoded to false in the default application.properties. Users who need AI features should use the -ai tagged image. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Separate config file with AI features enabled: ai-pipeline, skill-scanner, anonymous AI access, and MCP registry default to true. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
All Docker images now use JDK 17 exclusively. Remove version detection, CMS GC parameters, java.ext.dirs, and legacy GC logging flags. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
…gets Replace the single-stage ubuntu+python Dockerfile with a multi-stage build: downloader stage fetches nacos-server tarball, standard target uses eclipse-temurin:17-jre (Ubuntu), slim target uses eclipse-temurin:17-jre-alpine. Python, uv, cisco-ai-skill-scanner, and AI data packages are removed from both targets. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Layered on top of the standard nacos/nacos-server image. Adds Python 3.10 via uv, cisco-ai-skill-scanner, AI data packages, and application-ai.properties with AI features enabled. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Slim target is now a build stage in the main Dockerfile. Dockerfile.Slim was identical to Dockerfile since PR nacos-group#495. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
New ci.yml runs on pull_request to master: - Build test: verify standard and slim targets build for amd64+arm64 - Size check: report image sizes, warn if over baseline - Smoke test: start container in standalone mode, verify HTTP 200 Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Replace single-job workflow with three parallel jobs: - build-push-standard: tags v<version> + latest - build-push-slim: tags v<version>-slim + slim - build-push-ai: tags v<version>-ai (depends on standard) Upgrade all Actions: checkout@v4, setup-qemu-action@v3, setup-buildx-action@v3, login-action@v3, build-push-action@v6. Replace deprecated set-output with GITHUB_OUTPUT. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Document standard, slim, and AI image variants with size estimates. Add migration section for users upgrading from v3.2.0 who need AI features to switch to the -ai tag. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
eclipse-temurin:17-jre-alpine only supports amd64. Switch slim to JDK 21 alpine which supports both amd64 and arm64. Nacos 3.x is compatible with JDK 17+ so JDK 21 works without issues. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Nacos uses RocksDB via JNI which requires libstdc++.so.6. Alpine does not include it by default, causing startup failure with UnsatisfiedLinkError. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Standard ~570MB, slim ~426MB (uncompressed). Previous baselines (400MB/300MB) were based on compressed size estimates. Adjust to 600MB/450MB for uncompressed sizes. Signed-off-by: cxhello <caixiaohuichn@gmail.com>
Member
Author
|
Closing in favor of #507 (smaller scope: CI-only improvements without Dockerfile changes). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eclipse-temurin:17-jre(standard) +eclipse-temurin:17-jre-alpine(slim), removing bundled Python/AI dependenciesci.ymlfor PR validation (build test + size check + smoke test), rewrittenbuild&push.yamlfor three-image publish with upgraded Actions (v4/v6)Image Size Impact
v3.2.x)v3.2.x-slim)v3.2.x-ai)Breaking Changes
-aitagDockerfile.Slimremoved (slim is now a target in the mainDockerfile)Other Changes
application.properties: AI pipeline hardcoded tofalsein standard/slimapplication-ai.properties: new config with AI features enableddocker-startup.sh: removed JDK 8 dead code (CMS GC,java.ext.dirs)README.md: added image variants table and migration guideCloses #505