From 69b0b5c9e98f224fb7de8d270be29952dd8c01b0 Mon Sep 17 00:00:00 2001 From: Mathieu Rochette Date: Fri, 22 Oct 2021 00:05:01 +0200 Subject: [PATCH 1/2] compile for arm/v6 too --- .github/workflows/main.yml | 7 +++++-- Dockerfile | 14 +++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9285946..b2b02ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: docker: @@ -32,8 +35,8 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64,linux/arm64,linux/arm - push: true + platforms: linux/arm64,linux/arm/v6 + push: ${{ github.ref == 'refs/heads/master' }} tags: texthtml/midi-synthesizer-autoconnect:latest cache-from: type=gha cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 629f5e4..deef177 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ -FROM rust:1.54-bullseye AS builder +FROM alpine AS builder -WORKDIR /app +RUN apk add cargo --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ + +RUN apk add alsa-lib-dev -RUN apt-get update && apt-get install -y libasound2-dev +WORKDIR /app ADD .cargo /app/.cargo/ ADD Cargo.toml Cargo.lock .cargo /app/ @@ -16,11 +18,9 @@ ADD src /app/src/ RUN touch src/main.rs && \ cargo build --release --offline -FROM debian:bullseye +FROM alpine -RUN apt-get update && \ - apt-get install -y libasound2 && \ - rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache libgcc alsa-lib COPY --from=builder /app/target/release/midi-synthesizer-autoconnect /usr/bin/ From 92a39358ec52f6058fedf5abb421324d16c74523 Mon Sep 17 00:00:00 2001 From: Mathieu Rochette Date: Fri, 22 Oct 2021 21:35:22 +0200 Subject: [PATCH 2/2] compile for amd64 too --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2b02ca..6234270 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/arm64,linux/arm/v6 + platforms: linux/amd64,linux/arm64,linux/arm/v6 push: ${{ github.ref == 'refs/heads/master' }} tags: texthtml/midi-synthesizer-autoconnect:latest cache-from: type=gha