-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce Docker image sizes with multi-stage builds (#8)
* Reduce Docker image sizes with multi-stage builds
- Loading branch information
1 parent
e791c9f
commit a085df6
Showing
3 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
FROM rust:1.72 | ||
FROM rust:1.72 as builder | ||
|
||
COPY ./src ./homekit-mqtt-bridge/src | ||
COPY ./Cargo.toml ./homekit-mqtt-bridge/Cargo.toml | ||
|
||
WORKDIR ./homekit-mqtt-bridge | ||
|
||
RUN apt-get update && apt-get install -y libssl-dev && apt-get install -y cmake | ||
RUN apt-get update && apt-get install -y cmake | ||
|
||
RUN cargo build --release | ||
|
||
CMD ["./target/release/homekit-mqtt-bridge"] | ||
FROM debian:bookworm-slim | ||
|
||
RUN apt-get update && apt-get install -y openssl | ||
|
||
COPY --from=builder /homekit-mqtt-bridge/target/release/homekit-mqtt-bridge /usr/local/bin/homekit-mqtt-bridge | ||
|
||
CMD ["/usr/local/bin/homekit-mqtt-bridge"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
FROM rust:1.72 | ||
FROM rust:1.72 as builder | ||
|
||
COPY ./src ./yeelight-controller/src | ||
COPY ./Cargo.toml ./yeelight-controller/Cargo.toml | ||
|
||
WORKDIR ./yeelight-controller | ||
|
||
RUN apt-get update && apt-get install -y libssl-dev && apt-get install -y cmake | ||
RUN apt-get update && apt-get install -y cmake | ||
|
||
RUN cargo build --release | ||
|
||
CMD ["./target/release/yeelight-controller"] | ||
FROM debian:bookworm-slim | ||
|
||
RUN apt-get update && apt-get install -y openssl | ||
|
||
COPY --from=builder /yeelight-controller/target/release/yeelight-controller /usr/local/bin/yeelight-controller | ||
|
||
CMD ["/usr/local/bin/yeelight-controller"] |