Skip to content

Commit

Permalink
feat: add docker arm64 image
Browse files Browse the repository at this point in the history
  • Loading branch information
Vid201 authored and zsluedem committed Jun 5, 2024
1 parent 22e92b7 commit 82c4dd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 82c4dd6

Please sign in to comment.