diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2e97917e..0320706e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -63,13 +63,15 @@ jobs: - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64,linux/arm64 - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . push: true - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 provenance: false cache-from: type=gha cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 71195d53..65f09871 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,9 @@ COPY --from=planner /app/recipe.json recipe.json ARG BUILD_PROFILE=release ENV BUILD_PROFILE $BUILD_PROFILE +# Set the build target platform +ARG TARGETPLATFORM + # Install system dependencies RUN apt-get update && apt-get -y upgrade && apt-get install -y pkg-config libclang-dev libssl-dev @@ -30,7 +33,8 @@ RUN cargo chef cook --profile $BUILD_PROFILE --recipe-path recipe.json # Build application COPY . . -RUN cargo build --profile $BUILD_PROFILE --locked +RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then JEMALLOC_SYS_WITH_LG_PAGE=16 ; fi && \ + cargo build --profile $BUILD_PROFILE --locked # Copy application RUN cp /app/target/$BUILD_PROFILE/silius /app/silius