mirror of
https://github.com/Noratrieb/uptime.git
synced 2026-01-14 08:35:07 +01:00
docker
This commit is contained in:
parent
7ff9a67148
commit
64f5757298
2 changed files with 29 additions and 0 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/target
|
||||||
28
Containerfile
Normal file
28
Containerfile
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
FROM docker.io/library/rust:1.72 as build
|
||||||
|
|
||||||
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install musl-tools -y
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
|
||||||
|
RUN mkdir src
|
||||||
|
RUN echo "fn main() {}" > src/main.rs
|
||||||
|
|
||||||
|
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# now rebuild with the proper main
|
||||||
|
RUN touch src/main.rs
|
||||||
|
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
### RUN
|
||||||
|
FROM gcr.io/distroless/static-debian12
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=build /app/target/release/x86_64-unknown-linux-musl/uptime uptime
|
||||||
|
|
||||||
|
CMD ["/app/uptime"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue