[GH-ISSUE #83] Docker image is too large because /app/.cache/trivy/trivy.db is copied into runtime image #53

Open
opened 2026-02-27 07:17:44 +03:00 by kerem · 0 comments
Owner

Originally created by @jian53286 on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/83

Hi! Thanks for the great project.

I noticed the published Docker image is much larger than expected, and it looks like a packaging issue.

What I observed

  • Image: ghcr.io/jwadow/kiro-gateway:latest
  • Image size: about 1.17GB
  • Inside container:
    • /app is about 950MB
    • /app/.cache/trivy is about 949MB
    • /app/.cache/trivy/db/trivy.db is about 947MB

This seems unrelated to runtime requirements and likely got copied into the image during build (COPY . .).

Why this matters

  • Slower pull/deploy times
  • More disk usage on servers
  • Unnecessary transfer cost

Suggested fix

  1. Add cache exclusions to .dockerignore, at least:
    • .cache/
    • .cache/trivy/
  2. Consider whitelist-style copy in Dockerfile instead of COPY . ., e.g. only:
    • main.py
    • kiro/
    • requirements.txt
    • required runtime files
Originally created by @jian53286 on GitHub (Feb 25, 2026). Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/83 Hi! Thanks for the great project. I noticed the published Docker image is much larger than expected, and it looks like a packaging issue. ## What I observed - Image: `ghcr.io/jwadow/kiro-gateway:latest` - Image size: about **1.17GB** - Inside container: - `/app` is about **950MB** - `/app/.cache/trivy` is about **949MB** - `/app/.cache/trivy/db/trivy.db` is about **947MB** This seems unrelated to runtime requirements and likely got copied into the image during build (`COPY . .`). ## Why this matters - Slower pull/deploy times - More disk usage on servers - Unnecessary transfer cost ## Suggested fix 1. Add cache exclusions to `.dockerignore`, at least: - `.cache/` - `.cache/trivy/` 2. Consider whitelist-style copy in Dockerfile instead of `COPY . .`, e.g. only: - `main.py` - `kiro/` - `requirements.txt` - required runtime files
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/kiro-gateway-jwadow#53
No description provided.