Skip to content

Commit

Permalink
ci(docker): only enable simd on x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
Itsusinn committed May 20, 2024
1 parent 41cdda8 commit 20ae0dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ RUN apk add git gcc musl-dev
COPY . /app/tuic

WORKDIR /app/tuic
ARG RUSTFLAGS="-Ctarget-feature=+sse2,+sse3,+avx"

RUN if [ "$DOCKER_PLATFORM" = "amd64" ]; then \
echo "Setting RUSTFLAGS for x86_64" && \
export RUSTFLAGS="-Ctarget-feature=+sse2,+sse3,+avx" ; \
else \
export RUSTFLAGS="" ; \
fi

RUN cargo build --release --config net.git-fetch-with-cli=true --package tuic-server
RUN cp ./target/release/tuic-server /usr/bin/tuic-server
RUN chmod +x /usr/bin/tuic-server
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ jobs:
with:
context: .
file: .github/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/i386
push: true
tags: ghcr.io/${{ steps.get-ownername.outputs.OWNER }}/tuic-server:${{ steps.get-ver.outputs.TAG }}

Expand Down

0 comments on commit 20ae0dd

Please sign in to comment.