1
0
Fork 0
forked from lthn/blockchain

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.
This commit is contained in:
Snider 2025-09-27 18:15:08 +01:00
parent 1ed048d962
commit dea8becdd9
2 changed files with 7 additions and 2 deletions

View file

@ -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' }}

View file

@ -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