From dea8becdd9e10935161758273b66d48b22a9515b Mon Sep 17 00:00:00 2001 From: Snider Date: Sat, 27 Sep 2025 18:15:08 +0100 Subject: [PATCH] Update Docker build args and testnet symlink logic Adds build arguments to the Docker build workflow for testnet, threads, build target, and local build. Updates the Dockerfile to use the 'dev' branch by default and improves the testnet symlink creation logic to use sed for string replacement. --- .github/workflows/build-docker.yml | 5 +++++ utils/docker/images/lthn-chain/Dockerfile | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index dc193070..0a88fab3 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -43,5 +43,10 @@ jobs: file: utils/docker/images/lthn-chain/Dockerfile context: ${{ github.workspace }} push: true + build-args: | + BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + THREADS=2 + BUILD_TARGET=gcc-linux-x86_64 + BUILD_LOCAL=1 tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }} diff --git a/utils/docker/images/lthn-chain/Dockerfile b/utils/docker/images/lthn-chain/Dockerfile index 250b23ec..cc730097 100644 --- a/utils/docker/images/lthn-chain/Dockerfile +++ b/utils/docker/images/lthn-chain/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:24.04 AS builder LABEL authors="snider" ARG THREADS=1 -ARG BUILD_BRANCH=dev-configure-testnet-1 +ARG BUILD_BRANCH=dev ARG BUILD_LOCAL=1 ARG BUILD_REPO=https://github.com/letheanVPN/blockchain.git ARG BUILD_TARGET=gcc-linux-x86_64 @@ -52,7 +52,7 @@ RUN cmake --build ${BUILD_FOLDER} --config=${BUILD_TYPE} --parallel=${THREADS} RUN if [ "$BUILD_TESTNET" = "1" ]; then \ cd ${BUILD_FOLDER}/src && \ for f in lethean-testnet-*; do \ - ln -s "$f" "${f/-testnet/}"; \ + ln -s "$f" "$(echo "$f" | sed 's/-testnet//')"; \ done; \ fi