-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathContainerfile.install
More file actions
29 lines (24 loc) · 901 Bytes
/
Containerfile.install
File metadata and controls
29 lines (24 loc) · 901 Bytes
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
##
# BUILD STAGE
#############
FROM clux/muslrust:stable AS builder
ENV RUSTFLAGS="-C target-cpu=native"
# If we want to cache only the dependencies, we currently need to build twice -
# once just for dependencies and once for everything after copying.
COPY --chown=rust:rust Cargo.* ./
RUN mkdir src/
RUN echo 'fn main() {println!("dummy build for dependencies")}' > src/main.rs
RUN cargo build --release
# Remove the keepass-diff files of the dummy build
RUN rm -f target/x86_64-unknown-linux-musl/release/deps/keepass_diff-*
# Now run the real build after adding the real sources. The above lines are just
# for allowing better caching
COPY --chown=rust:rust src ./src
RUN cargo build --release
##
# RUN STAGE
#############
FROM scratch
WORKDIR /app
COPY --from=builder /volume/target/x86_64-unknown-linux-musl/release/keepass-diff /usr/local/bin/
ENTRYPOINT [ "/usr/local/bin/keepass-diff" ]