-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
37 lines (27 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Use the official Rust image as the base image
FROM rust:latest AS builder
# Set the working directory inside the container
WORKDIR /usr/src/smartshreds
# Copy the Cargo.toml and Cargo.lock files
COPY smartshreds/Cargo.toml smartshreds/Cargo.lock ./
# Copy the source code
COPY smartshreds/src ./src
COPY smartshreds/src/resources ./resources
COPY smartshreds/src/org.gtk_rs.SmartShreds.gschema.xml ./
# Build the application in release mode
RUN cargo build --release
# Use a minimal base image for the final stage
FROM debian:buster-slim
# Install necessary dependencies
RUN apt-get update && apt-get install -y \
libgtk-3-0 \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory inside the container
WORKDIR /usr/local/bin
# Copy the built binary from the builder stage
COPY --from=builder /usr/src/smartshreds/target/release/smartshreds .
# Copy the resources
COPY --from=builder /usr/src/smartshreds/resources ./resources
COPY --from=builder /usr/src/smartshreds/org.gtk_rs.SmartShreds.gschema.xml ./
# Set the entrypoint to the application binary
ENTRYPOINT ["./smartshreds"]