Add container build script

master
Dustin 2025-09-25 18:01:39 -05:00
parent d937bd6fb2
commit afb0f53c7b
2 changed files with 24 additions and 0 deletions

4
.containerignore Normal file
View File

@ -0,0 +1,4 @@
*
!src
!Cargo.toml
!Cargo.lock

20
Containerfile Normal file
View File

@ -0,0 +1,20 @@
FROM docker.io/library/rust:1.88-alpine AS build
RUN apk --no-cache add musl-dev
WORKDIR /src
COPY . .
RUN cargo build --release --locked
RUN strip target/release/k8s-reboot-controller
FROM scratch
COPY --from=build /src/target/release/k8s-reboot-controller /
ENV ROCKET_CLI_COLORS=false
ENTRYPOINT ["/k8s-reboot-controller"]