Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce Docker image sizes with multi-stage builds #8

Merged
merged 2 commits into from
Jun 22, 2024

Conversation

chicoferreira
Copy link
Owner

@chicoferreira chicoferreira commented Jun 22, 2024

Related to #1

Implements multi-stage builds in Dockerfiles for homekit-mqtt-bridge and yeelight-controller to reduce image sizes.

  • Introduces a builder stage using rust:1.72 for compiling the Rust applications in both Dockerfiles.
  • Adds a runtime stage using debian:buster-slim to create lighter final images.
  • Copies the compiled executables from the builder stage to the runtime stage, ensuring only necessary binaries and dependencies are included in the final images.
  • Updates the CMD instruction to execute the copied binaries from their new location in /usr/local/bin/.

For more details, open the Copilot Workspace session.

@chicoferreira chicoferreira merged commit a085df6 into main Jun 22, 2024
2 checks passed
@chicoferreira chicoferreira deleted the reduce-image-size branch June 22, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant