From 760944cfbe4ea41183689f1564241a30a7ce4ef2 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Mon, 11 Nov 2024 08:42:26 -0800 Subject: [PATCH] Use nightly cargo and enable arm64 builds again --- .github/workflows/on-tag.yml | 8 ++++---- Dockerfile | 14 +++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/on-tag.yml b/.github/workflows/on-tag.yml index f3e200e0..d8d63f85 100644 --- a/.github/workflows/on-tag.yml +++ b/.github/workflows/on-tag.yml @@ -65,9 +65,9 @@ jobs: - name: Checkout project uses: actions/checkout@v3 - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # id: qemu + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + id: qemu - name: Setup Docker buildx action uses: docker/setup-buildx-action@v3 @@ -90,7 +90,7 @@ jobs: docker buildx build \ --cache-from "type=local,src=/tmp/.buildx-cache" \ --cache-to "type=local,dest=/tmp/.buildx-cache" \ - --platform linux/amd64 \ + --platform linux/amd64,linux/arm64 \ --tag ${{ secrets.DOCKER_HUB_USER }}/electrs:$TAG \ --tag ${{ secrets.DOCKER_HUB_USER }}/electrs:latest \ --output "type=registry" . \ diff --git a/Dockerfile b/Dockerfile index b57becdc..06e9cb74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,24 @@ FROM debian:bookworm-slim AS base +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true + RUN apt update -qy -RUN apt install -qy librocksdb-dev +RUN apt install -qy librocksdb-dev curl FROM base as build -RUN apt install -qy git cargo clang cmake +RUN apt install -qy git clang cmake + +ENV RUSTUP_HOME=/rust +ENV CARGO_HOME=/cargo +ENV PATH=/cargo/bin:/rust/bin:$PATH + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly WORKDIR /build COPY . . -RUN cargo build --release --bin electrs +RUN cargo +nightly build --release -Z sparse-registry --bin electrs FROM base as deploy