Description
Optimize the linux-sysmonitor Docker image by implementing a multi-stage build. Separate build-time dependencies from runtime dependencies so the final image contains only what is required to execute the application.
Tasks
Acceptance Criteria
- Multi-stage Dockerfile is implemented successfully.
- Final image is measurably smaller than
linux-sysmonitor:v1.
- Container builds without errors.
- Container executes successfully and produces the same output as the previous version.
- Image optimization results are documented with before/after size comparison.
Commit Message
feat: convert to multi-stage build to reduce image size (closes #14)
Why This Matters
Multi-stage builds are a Docker best practice for production deployments. They help create smaller, faster, and more secure images by excluding unnecessary build tools from the final runtime image.
This ticket reinforces key Docker concepts, including:
- Multi-stage builds
- Builder vs Runtime stages
COPY --from
- Image size optimization
- Security through minimal images
- Faster image pulls and deployments
Interview Tip: Be ready to explain why multi-stage builds reduce image size, what stays in the builder stage versus the runtime stage, and quantify your optimization with the actual before/after image sizes.
Description
Optimize the
linux-sysmonitorDocker image by implementing a multi-stage build. Separate build-time dependencies from runtime dependencies so the final image contains only what is required to execute the application.Tasks
COPY --from=builderto copy only the necessary artifacts into the final image.docker build -t linux-sysmonitor:v2 .docker images | grep linux-sysmonitorNOTES.mdor the commit description.Acceptance Criteria
linux-sysmonitor:v1.Commit Message
Why This Matters
Multi-stage builds are a Docker best practice for production deployments. They help create smaller, faster, and more secure images by excluding unnecessary build tools from the final runtime image.
This ticket reinforces key Docker concepts, including:
COPY --from