From 082566f7c9d6098c528613236578c8babf0abb51 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 4 Jun 2024 19:05:49 +0530 Subject: [PATCH] Extend bsc Dockerfile for additional dependencies --- stack-orchestrator/compose/docker-compose-bsc-node.yml | 2 +- stack-orchestrator/config/docker-entrypoint.sh | 4 ++-- .../container-build/cerc-bsc-geth/Dockerfile | 5 +++++ stack-orchestrator/container-build/cerc-bsc-geth/build.sh | 7 +++++++ stack-orchestrator/stacks/bsc-node/stack.yml | 8 ++++++++ 5 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 stack-orchestrator/container-build/cerc-bsc-geth/Dockerfile create mode 100755 stack-orchestrator/container-build/cerc-bsc-geth/build.sh create mode 100644 stack-orchestrator/stacks/bsc-node/stack.yml diff --git a/stack-orchestrator/compose/docker-compose-bsc-node.yml b/stack-orchestrator/compose/docker-compose-bsc-node.yml index 58c1dea..257cbe9 100644 --- a/stack-orchestrator/compose/docker-compose-bsc-node.yml +++ b/stack-orchestrator/compose/docker-compose-bsc-node.yml @@ -1,6 +1,6 @@ services: bsc: - image: ghcr.io/bnb-chain/bsc:1.4.8 + image: cerc/bsc-geth:local restart: unless-stopped environment: CERC_BSC_NETWORK: ${CERC_BSC_NETWORK:-mainnet} diff --git a/stack-orchestrator/config/docker-entrypoint.sh b/stack-orchestrator/config/docker-entrypoint.sh index fd3c184..6d40fbc 100755 --- a/stack-orchestrator/config/docker-entrypoint.sh +++ b/stack-orchestrator/config/docker-entrypoint.sh @@ -28,9 +28,9 @@ if [ ! -d "$geth_dir" ] && [ "${CERC_USE_SNAPSHOT}" = "true" ] && [ -n "$snapsho if [ "$CERC_BSC_NETWORK" = "testnet" ]; then # Snapshot dir structure for testnet is different than that for mainnet - tar -C /${DATA_DIR}/ -I lz4 -xvf ${snapshot_file} --strip-components=3 server/testnet/dataseed/geth + lz4 -d ${snapshot_file} | tar -C ${DATA_DIR}/ -xvf - --strip-components=3 server/testnet/dataseed/geth else - tar -C /${DATA_DIR}/ -I lz4 -xvf ${snapshot_file} --strip-components=2 server/data-seed/geth + lz4 -d ${snapshot_file} | tar -C ${DATA_DIR}/ -xvf - --strip-components=2 server/data-seed/geth fi if [ "${CERC_FAST_NODE}" = "true" ]; then diff --git a/stack-orchestrator/container-build/cerc-bsc-geth/Dockerfile b/stack-orchestrator/container-build/cerc-bsc-geth/Dockerfile new file mode 100644 index 0000000..a1771c6 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-bsc-geth/Dockerfile @@ -0,0 +1,5 @@ +FROM ghcr.io/bnb-chain/bsc:1.4.8 + +USER root +RUN apk add lz4 +USER bsc diff --git a/stack-orchestrator/container-build/cerc-bsc-geth/build.sh b/stack-orchestrator/container-build/cerc-bsc-geth/build.sh new file mode 100755 index 0000000..3c398ac --- /dev/null +++ b/stack-orchestrator/container-build/cerc-bsc-geth/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Build cerc/bsc-geth +docker build -t cerc/bsc-geth:local ${build_command_args} ${SCRIPT_DIR} diff --git a/stack-orchestrator/stacks/bsc-node/stack.yml b/stack-orchestrator/stacks/bsc-node/stack.yml new file mode 100644 index 0000000..a017c2e --- /dev/null +++ b/stack-orchestrator/stacks/bsc-node/stack.yml @@ -0,0 +1,8 @@ +version: "1.0" +name: bsc-node +description: "BSC node stack" +repos: +containers: + - cerc/bsc-geth +pods: + - bsc-node