forked from lthn/blockchain
Simplify Docker build workflow and update dependencies
Refactored the GitHub Actions workflow to remove the build matrix and multi-arch manifest steps, consolidating the build into a single job targeting a specific build target. Updated the Dockerfile to add python-is-python3 and python3-dev to dependencies for improved Python compatibility.
This commit is contained in:
parent
3ad2df6f9f
commit
7d7cfb7a5b
2 changed files with 9 additions and 71 deletions
76
.github/workflows/build-docker.yml
vendored
76
.github/workflows/build-docker.yml
vendored
|
|
@ -1,7 +1,6 @@
|
|||
name: Docker
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
|
|
@ -18,25 +17,8 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet-' || '' }}${{ matrix.arch_tag }}"
|
||||
name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}"
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le, linux/riscv64, linux/s390x ]
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
arch_tag: amd64
|
||||
- platform: linux/arm64
|
||||
arch_tag: arm64
|
||||
- platform: linux/arm/v7
|
||||
arch_tag: armv7
|
||||
- platform: linux/ppc64le
|
||||
arch_tag: ppc64le
|
||||
- platform: linux/riscv64
|
||||
arch_tag: riscv64
|
||||
- platform: linux/s390x
|
||||
arch_tag: s390x
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
|
@ -44,71 +26,27 @@ jobs:
|
|||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build ${{ matrix.platform }}
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
continue-on-error: true
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: utils/docker/images/lthn-chain/Dockerfile
|
||||
context: ${{ github.workspace }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
push: true
|
||||
build-args: |
|
||||
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
||||
THREADS=2
|
||||
BUILD_TARGET=gcc-linux-x86_64
|
||||
BUILD_LOCAL=1
|
||||
USE_CUSTOM_PROFILE=0
|
||||
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet-' || '' }}${{ matrix.arch_tag }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
finalize_manifest:
|
||||
needs: build
|
||||
name: Multi-Arch Image
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build
|
||||
id: docker_final
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: utils/docker/images/lthn-chain/Dockerfile
|
||||
context: ${{ github.workspace }}
|
||||
platforms: "linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le, linux/riscv64, linux/s390x"
|
||||
push: true
|
||||
build-args: |
|
||||
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
|
||||
THREADS=2
|
||||
BUILD_LOCAL=1
|
||||
USE_CUSTOM_PROFILE=0
|
||||
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ RUN apt update && apt -y upgrade
|
|||
|
||||
RUN apt install -y build-essential pkgconf \
|
||||
curl ca-certificates bison autotools-dev checkinstall \
|
||||
g++ llvm clang lld cmake \
|
||||
git python3 python3-pip xz-utils gperf
|
||||
g++ llvm clang lld cmake python-is-python3 \
|
||||
git python3 python3-pip python3-dev xz-utils gperf
|
||||
|
||||
RUN pip3 install conan --break-system-packages
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue