Gilfeather/furnace

🐳 Optimize Docker image size

オヌプン

#8 opened on 2025/07/16

 (0 件のコメント) (0 件のリアクション) (0 人の担圓者)Rust (5 件のフォヌク)auto 404
good first issuehelp wanted

Repository metrics

Stars
 (64 個のスタヌ)
PR merge metrics
 (30d に merged PR はありたせん)

説明

Description

Create a multi-stage Dockerfile to reduce the final image size and improve deployment efficiency.

Acceptance Criteria

  • Create optimized multi-stage Dockerfile
  • Use Alpine or distroless base image for final stage
  • Final image should be under 50MB
  • Include only necessary runtime dependencies
  • Add .dockerignore file to exclude unnecessary files
  • Update README with Docker usage instructions

Current Advantages

The switch to built-in models provides significant advantages for Docker optimization:

  • ✅ No external model files to copy (models compiled into binary)
  • ✅ Smaller attack surface (no external dependencies)
  • ✅ Faster startup (no model loading from disk)
  • ✅ Single binary deployment

Implementation Guidance

  • Use rust:alpine for build stage
  • Use scratch or alpine for runtime stage
  • Copy only the furnace binary (no model files needed)
  • Consider static linking for zero dependencies
  • Test with --model-name resnet18 (built-in model)
  • Update .dockerignore to exclude models/ directory

Expected Image Size

With built-in models, the final image should be significantly smaller:

  • Binary size: ~4.5MB
  • Base image: ~5MB (Alpine) or ~2MB (distroless)
  • Target: Under 20MB (more aggressive than original 50MB target)

Estimated Difficulty

Easy - Half day (easier due to built-in models)

コントリビュヌタヌガむド