From faf58118a4244add6d0185103130eb3c00d458fa Mon Sep 17 00:00:00 2001 From: neodix42 Date: Wed, 5 Mar 2025 10:29:49 +0400 Subject: [PATCH] Fix failing docker build - arm64 (#1541) * fix docker github build (Segmentation fault (core dumped) dpkg: error processing package libc-bin (--configure)) * fix docker github build (Segmentation fault (core dumped) dpkg: error processing package libc-bin (--configure)) * update gh qemu actions * run on ubuntu 24.04 * try driver-opts: image=moby/buildkit:v0.11.0 * split docker images for amd64 and arm64 * Revert "split docker images for amd64 and arm64" This reverts commit 609617f0056ac1eff7b34dce146b864de19de527. * clean libc-bin --- .../workflows/docker-ubuntu-branch-image.yml | 17 +++++++++++++++-- .github/workflows/docker-ubuntu-image.yml | 6 +++--- Dockerfile | 10 +++++++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-ubuntu-branch-image.yml b/.github/workflows/docker-ubuntu-branch-image.yml index afde104a..00aa5015 100644 --- a/.github/workflows/docker-ubuntu-branch-image.yml +++ b/.github/workflows/docker-ubuntu-branch-image.yml @@ -20,10 +20,12 @@ jobs: submodules: 'recursive' - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v3.5.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v3.10.0 + with: + driver-opts: image=moby/buildkit:v0.11.0 - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -32,6 +34,17 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and export to Docker + uses: docker/build-push-action@v6 + with: + load: true + context: ./ + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test + + - name: Test + run: | + docker run --rm -e "TEST=1" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test + - name: Get tag as branch name id: tag run: | diff --git a/.github/workflows/docker-ubuntu-image.yml b/.github/workflows/docker-ubuntu-image.yml index 48c553ef..aa4eaeef 100644 --- a/.github/workflows/docker-ubuntu-image.yml +++ b/.github/workflows/docker-ubuntu-image.yml @@ -20,10 +20,10 @@ jobs: submodules: 'recursive' - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - + uses: docker/setup-qemu-action@v3.5.0 + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v3.10.0 - name: Login to GitHub Container Registry uses: docker/login-action@v3 diff --git a/Dockerfile b/Dockerfile index 61e18c0b..f1b836bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,13 @@ FROM ubuntu:22.04 AS builder +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git ninja-build libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool libjemalloc-dev lsb-release software-properties-common gnupg + rm /var/lib/dpkg/info/libc-bin.* && \ + apt-get clean && \ + apt-get update && \ + apt install libc-bin && \ + apt-get install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git \ + ninja-build libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool \ + libjemalloc-dev lsb-release software-properties-common gnupg RUN wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ @@ -25,6 +32,7 @@ RUN mkdir build && \ blockchain-explorer emulator tonlibjson http-proxy adnl-proxy FROM ubuntu:22.04 +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y wget curl libatomic1 openssl libsodium-dev libmicrohttpd-dev liblz4-dev libjemalloc-dev htop \ net-tools netcat iptraf-ng jq tcpdump pv plzip && \