Skip to content

Commit

Permalink
fix: musl build
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 16, 2023
1 parent af2994a commit 1d3d674
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ jobs:
os: windows-latest
ext: .exe
archive: zip
- target: aarch64-pc-windows-msvc
os: windows-latest
ext: .exe
archive: zip
# - target: aarch64-pc-windows-msvc
# os: windows-latest
# ext: .exe
# archive: zip
- target: i686-pc-windows-msvc
os: windows-latest
ext: .exe
archive: zip
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive: tar.gz
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
archive: tar.gz
- target: x86_64-unknown-linux-musl
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
file: ./manifest/docker/release/x86_64-linux-musl/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ tracing-futures = "0.2.5"
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
url = "2.3.1"
uuid = { version = "1.2.1", features = ["v1", "v4"] }

[target.'cfg(target_env = "musl")'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }

3 changes: 3 additions & 0 deletions manifest/docker/builder/aarch64-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM messense/rust-musl-cross:aarch64-musl
RUN rustup update nightly && \
rustup target add --toolchain nightly aarch64-unknown-linux-musl
4 changes: 3 additions & 1 deletion Dockerfile → ...cker/release/x86_64-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM clux/muslrust:stable as builder
RUN rustup update nightly && \
rustup target add --toolchain nightly x86_64-unknown-linux-musl
WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl
Expand All @@ -11,7 +13,7 @@ RUN apk add alpine-conf tzdata && \

ENV WORKDIR /app
VOLUME $WORKDIR/data
ADD config.example.toml $WORKDIR/data/
ADD ./config.example.toml $WORKDIR/data/
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/jsdelivr_proxy $WORKDIR/jsdelivr_proxy
WORKDIR $WORKDIR

Expand Down

0 comments on commit 1d3d674

Please sign in to comment.