1
0
mirror of https://github.com/orhun/kmon synced 2024-07-03 08:08:59 +00:00
kmon/Dockerfile
2023-04-06 22:40:36 +03:00

28 lines
923 B
Docker

# Builder
FROM rust:1.68.2-slim-buster as builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
--allow-unauthenticated \
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app/
COPY Cargo.toml Cargo.toml
RUN mkdir src/ && echo "fn main() {println!(\"failed to build\")}" > src/main.rs
RUN cargo build --release --verbose
RUN rm -f target/release/deps/kmon*
COPY . .
RUN cargo build --locked --release --verbose
RUN mkdir -p build-out && cp target/release/kmon build-out/
# Runtime
FROM debian:buster-slim as runtime-image
RUN apt-get update && \
apt-get install -y --no-install-recommends \
--allow-unauthenticated \
kmod \
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /root/
COPY --from=builder /app/build-out/kmon .
CMD ["./kmon"]