-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
651 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
ARG TARGET=x86_64-unknown-linux-musl | ||
ARG PROFILE=release | ||
|
||
FROM rust AS build | ||
ARG PROFILE | ||
ARG TARGET | ||
ARG TARGETARCH | ||
ARG PROFILE=release | ||
|
||
COPY src /src | ||
WORKDIR /src | ||
|
||
RUN echo no-target-detected > /target | ||
|
||
RUN if [ "$TARGETARCH" = "386" ]; then\ | ||
echo i686-unknown-linux-musl > /target; fi | ||
RUN if [ "$TARGETARCH" = "amd64" ]; then\ | ||
echo x86_64-unknown-linux-musl > /target; fi | ||
RUN if [ "$TARGETARCH" = "arm" ]; then\ | ||
echo arm-unknown-linux-musleabihf > /target; fi | ||
RUN if [ "$TARGETARCH" = "arm64" ]; then\ | ||
echo aarch64-unknown-linux-musl > /target; fi | ||
|
||
ENV RUSTFLAGS="-C target-feature=+crt-static" | ||
|
||
RUN rustup target add $TARGET | ||
RUN rustup target add $(cat /target) | ||
|
||
RUN cargo build -p crusader --no-default-features --profile=$PROFILE --target $(cat /target) | ||
|
||
RUN cargo fetch | ||
RUN cargo build -p crusader --profile=$PROFILE --target $TARGET | ||
RUN cp target/$(cat /target)/$PROFILE/crusader / | ||
|
||
FROM scratch | ||
ARG PROFILE | ||
ARG TARGET | ||
COPY --from=build /src/target/$TARGET/$PROFILE/crusader /crusader | ||
COPY --from=build /crusader / | ||
|
||
EXPOSE 35481/tcp 35481/udp | ||
ENTRYPOINT [ "/crusader", "serve" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ lto = "fat" | |
|
||
[profile.size] | ||
inherits = "speed" | ||
opt-level = "s" | ||
opt-level = "z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.