2024-07-02 18:54:16 +03:00
|
|
|
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-02-24 10:18:50 +03:00
|
|
|
FROM clux/muslrust:stable AS build
|
2021-01-20 03:48:20 +03:00
|
|
|
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
|
|
|
|
# Build with a dummy main to pre-build dependencies
|
|
|
|
RUN mkdir src && \
|
2021-03-06 20:38:54 +03:00
|
|
|
sed -i '/test_client/d' Cargo.toml && \
|
2021-01-20 03:48:20 +03:00
|
|
|
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/
|
2021-02-26 18:13:14 +03:00
|
|
|
COPY src/ ./src/
|
2023-02-24 10:18:50 +03:00
|
|
|
RUN touch src/main.rs
|
2021-01-20 03:48:20 +03:00
|
|
|
|
|
|
|
RUN cargo build --release
|
|
|
|
|
2024-10-01 19:57:47 +03:00
|
|
|
# Pick the executable file for the right architecture and system
|
|
|
|
RUN mv /volume/target/*-unknown-*-musl/release/notify_push /notify_push
|
|
|
|
|
2021-01-20 03:48:20 +03:00
|
|
|
FROM scratch
|
|
|
|
|
2024-10-01 19:57:47 +03:00
|
|
|
COPY --from=build /notify_push /
|
2021-02-24 00:12:34 +03:00
|
|
|
EXPOSE 7867
|
2021-01-20 03:48:20 +03:00
|
|
|
|
2023-02-24 10:18:50 +03:00
|
|
|
CMD ["/notify_push"]
|