2021-01-20 03:48:20 +03:00
|
|
|
FROM ekidd/rust-musl-builder AS build
|
|
|
|
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
|
|
|
|
# Build with a dummy main to pre-build dependencies
|
|
|
|
RUN mkdir src && \
|
|
|
|
echo "fn main(){}" > src/main.rs && \
|
|
|
|
cargo build --release && \
|
|
|
|
rm -r src
|
|
|
|
|
2021-02-09 02:39:26 +03:00
|
|
|
COPY build.rs ./
|
2021-02-09 15:38:04 +03:00
|
|
|
COPY appinfo/info.xml ./appinfo/
|
|
|
|
COPY src/* ./src/
|
2021-01-20 03:48:20 +03:00
|
|
|
RUN sudo chown -R rust:rust . && touch src/main.rs
|
|
|
|
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/notify_push /
|
2021-02-24 00:12:34 +03:00
|
|
|
EXPOSE 7867
|
2021-01-20 03:48:20 +03:00
|
|
|
|
|
|
|
CMD ["/notify_push"]
|