diff --git a/besu.yml b/besu.yml index bb846fd6..9a5e6fab 100644 --- a/besu.yml +++ b/besu.yml @@ -15,8 +15,10 @@ services: context: ./besu dockerfile: ${BESU_DOCKERFILE} args: - - BUILD_TARGET=${BESU_SRC_BUILD_TARGET} - - DOCKER_TAG=${BESU_DOCKER_TAG} + - BUILD_TARGET=${BESU_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${BESU_SRC_REPO:-https://github.com/hyperledger/besu} + - DOCKER_TAG=${BESU_DOCKER_TAG:-latest} + - DOCKER_REPO=${BESU_DOCKER_REPO:-hyperledger/besu} image: besu:local user: besu environment: diff --git a/besu/Dockerfile.binary b/besu/Dockerfile.binary index 43c88053..6e7d9c43 100644 --- a/besu/Dockerfile.binary +++ b/besu/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM hyperledger/besu:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Unused but included to avoid warnings ARG BUILD_TARGET +ARG SRC_REPO ARG USER=besu ARG UID=10001 diff --git a/besu/Dockerfile.source b/besu/Dockerfile.source index 275086ac..0a8b589b 100644 --- a/besu/Dockerfile.source +++ b/besu/Dockerfile.source @@ -3,13 +3,15 @@ FROM eclipse-temurin:17-jdk-jammy as builder # This is here to avoid build-time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates git WORKDIR /usr/src -RUN bash -c "git clone --recurse-submodules -j8 https://github.com/hyperledger/besu.git && cd besu && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:besu-pr; git checkout besu-pr; else git checkout ${BUILD_TARGET}; fi && ./gradlew installDist" +RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} besu && cd besu && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:besu-pr; git checkout besu-pr; else git checkout ${BUILD_TARGET}; fi && ./gradlew installDist" # Pull all binaries into a second stage deploy Ubuntu container FROM eclipse-temurin:17-jre-jammy diff --git a/default.env b/default.env index 238cb441..a9478c95 100644 --- a/default.env +++ b/default.env @@ -159,84 +159,111 @@ SSV2_NODE_TAG=latest # MEV-Boost # If mev-boost terminates with a SIGILL, make this one of the "portable" tags MEV_DOCKER_TAG=latest +MEV_DOCKER_REPO=flashbots/mev-boost MEV_DOCKERFILE=Dockerfile.binary # Nimbus # SRC build target can be a tag, a branch, or a pr as "pr-ID" NIM_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +NIM_SRC_REPO=https://github.com/status-im/nimbus-eth2 NIM_DOCKER_TAG=multiarch-latest NIM_DOCKER_VC_TAG=multiarch-latest +NIM_DOCKER_REPO=statusim/nimbus-eth2 +NIM_DOCKER_VC_REPO=statusim/nimbus-validator-client NIM_DOCKERFILE=Dockerfile.binary # Teku # SRC build target can be a tag, a branch, or a pr as "pr-ID" TEKU_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +TEKU_SRC_REPO=https://github.com/ConsenSys/teku TEKU_DOCKER_TAG=latest +TEKU_DOCKER_REPO=consensys/teku TEKU_DOCKERFILE=Dockerfile.binary # Lighthouse # SRC build target can be a tag, a branch, or a pr as "pr-ID" LH_SRC_BUILD_TARGET=stable +LH_SRC_REPO=https://github.com/sigp/lighthouse # If Lighthouse terminates with a SIGILL, make this "latest" LH_DOCKER_TAG=latest-modern +LH_DOCKER_REPO=sigp/lighthouse LH_DOCKERFILE=Dockerfile.binary # Prysm # SRC build target can be a tag, a branch, or a pr as "pr-ID" PRYSM_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +PRYSM_SRC_REPO=https://github.com/prysmaticlabs/prysm PRYSM_DOCKER_TAG=stable PRYSM_DOCKER_VC_TAG=stable +PRYSM_DOCKER_REPO=gcr.io/prysmaticlabs/prysm/beacon-chain +PRYSM_DOCKER_VC_REPO=gcr.io/prysmaticlabs/prysm/validator PRYSM_DOCKERFILE=Dockerfile.binary # Lodestar # SRC build target can be a tag, a branch, or a pr as "pr-ID" LS_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +LS_SRC_REPO=https://github.com/ChainSafe/lodestar LS_DOCKER_TAG=latest +LS_DOCKER_REPO=chainsafe/lodestar LS_DOCKERFILE=Dockerfile.binary # Web3Signer W3S_DOCKER_TAG=latest +W3S_DOCKER_REPO=consensys/web3signer PG_DOCKER_TAG=alpine # Besu # SRC build target can be a tag, a branch, or a pr as "pr-ID" BESU_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +BESU_SRC_REPO=https://github.com/hyperledger/besu BESU_DOCKER_TAG=latest +BESU_DOCKER_REPO=hyperledger/besu BESU_DOCKERFILE=Dockerfile.binary # Erigon # SRC build target can be a tag, a branch, or a pr as "pr-ID" ERIGON_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +ERIGON_SRC_REPO=https://github.com/ledgerwatch/erigon ERIGON_DOCKER_TAG=stable +ERIGON_DOCKER_REPO=thorax/erigon ERIGON_DOCKERFILE=Dockerfile.binary # Nethermind # SRC build target can be a tag, a branch, or a pr as "pr-ID" NM_SRC_BUILD_TARGET='$(git tag --sort=-committerdate | grep -E "^[0-9]+[.][0-9]+[.][0-9]+$" | head -1)' +NM_SRC_REPO=https://github.com/NethermindEth/nethermind NM_DOCKER_TAG=latest +NM_DOCKER_REPO=nethermind/nethermind NM_DOCKERFILE=Dockerfile.binary # Go-Ethereum aka Geth # SRC build target can be a tag, a branch, or a pr as "pr-ID" GETH_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +GETH_SRC_REPO=https://github.com/ethereum/go-ethereum GETH_DOCKER_TAG=stable +GETH_DOCKER_REPO=ethereum/client-go GETH_DOCKERFILE=Dockerfile.binary # Nimbus EL # SRC build target can be a tag, a branch, or a pr as "pr-ID" NIMEL_SRC_BUILD_TARGET=master +NIMEL_SRC_REPO=https://github.com/status-im/nimbus-eth1 NIMEL_DOCKER_TAG=nonesuch +NIMEL_DOCKER_REPO=nonesuch NIMEL_DOCKERFILE=Dockerfile.source # Reth # SRC build target can be a tag, a branch, or a pr as "pr-ID" RETH_SRC_BUILD_TARGET=main +RETH_SRC_REPO=https://github.com/paradigmxyz/reth RETH_DOCKER_TAG=latest +RETH_DOCKER_REPO=ghcr.io/paradigmxyz/reth RETH_DOCKERFILE=Dockerfile.binary # staking-deposit-cli # SRC build target can be a tag, a branch, or a pr as "pr-ID" DEPCLI_SRC_BUILD_TARGET='$(git describe --tags $(git rev-list --tags --max-count=1))' +DEPCLI_SRC_REPO=https://github.com/ethereum/staking-deposit-cli # Does not (yet?) exist on Docker hub DEPCLI_DOCKER_TAG=nonesuch diff --git a/deposit-cli.yml b/deposit-cli.yml index 80fda08a..9449f798 100644 --- a/deposit-cli.yml +++ b/deposit-cli.yml @@ -6,7 +6,8 @@ services: build: context: ./staking-deposit-cli args: - - BUILD_TARGET=${DEPCLI_SRC_BUILD_TARGET} + - BUILD_TARGET=${DEPCLI_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${DEPCLI_SRC_REPO:-https://github.com/ethereum/staking-deposit-cli} image: staking-deposit-cli:local volumes: - ./.eth:/app/.eth/ diff --git a/erigon.yml b/erigon.yml index 699c542a..64379659 100644 --- a/erigon.yml +++ b/erigon.yml @@ -14,8 +14,10 @@ services: context: ./erigon dockerfile: ${ERIGON_DOCKERFILE} args: - - BUILD_TARGET=${ERIGON_SRC_BUILD_TARGET} - - DOCKER_TAG=${ERIGON_DOCKER_TAG} + - BUILD_TARGET=${ERIGON_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${ERIGON_SRC_REPO:-https://github.com/ledgerwatch/erigon} + - DOCKER_TAG=${ERIGON_DOCKER_TAG:-stable} + - DOCKER_REPO=${ERIGON_DOCKER_REPO:-thorax/erigon} stop_grace_period: 5m image: erigon:local user: erigon diff --git a/erigon/Dockerfile.binary b/erigon/Dockerfile.binary index 670f1827..f318ee5d 100644 --- a/erigon/Dockerfile.binary +++ b/erigon/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM thorax/erigon:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Unused, this is here to avoid build time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=erigon ARG UID=10001 diff --git a/erigon/Dockerfile.source b/erigon/Dockerfile.source index ab7ddc17..42c65f52 100644 --- a/erigon/Dockerfile.source +++ b/erigon/Dockerfile.source @@ -3,13 +3,15 @@ FROM golang:1.20-alpine as builder # Unused, this is here to avoid build time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apk update && apk add --no-cache make gcc g++ musl-dev linux-headers git bash WORKDIR /src -RUN bash -c "git clone --recurse-submodules -j8 https://github.com/ledgerwatch/erigon.git && cd erigon && git config advice.detachedHead false && git fetch --all --tags && \ +RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} erigon && cd erigon && git config advice.detachedHead false && git fetch --all --tags && \ if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:erigon-pr; git checkout erigon-pr; else git checkout ${BUILD_TARGET}; fi && make erigon" # Pull all binaries into a second stage deploy container diff --git a/ethd b/ethd index 6a87ebfe..f08607cf 100755 --- a/ethd +++ b/ethd @@ -679,14 +679,16 @@ envmigrate() { PRYSM_PORT DOPPELGANGER PRYSM_UDP_PORT GRAFANA_PORT PROMETHEUS_PORT KEY_API_PORT TRAEFIK_WEB_PORT TRAEFIK_WEB_HTTP_PORT \ CL_REST_PORT EL_RPC_PORT EL_WS_PORT EE_PORT ERIGON_TORRENT_PORT LOG_LEVEL JWT_SECRET EL_EXTRAS CL_EXTRAS \ VC_EXTRAS ARCHIVE_NODE SSV_P2P_PORT SSV_P2P_PORT_UDP ERIGON_P2P_PORT_2 ERIGON_P2P_PORT_3 ) - TARGET_VARS=( NIM_SRC_BUILD_TARGET NIM_DOCKER_TAG NIM_DOCKER_VC_TAG NIM_DOCKERFILE TEKU_SRC_BUILD_TARGET TEKU_DOCKER_TAG \ - TEKU_DOCKERFILE LH_SRC_BUILD_TARGET LH_DOCKER_TAG LH_DOCKERFILE PRYSM_SRC_BUILD_TARGET \ - PRYSM_DOCKER_TAG PRYSM_DOCKER_VC_TAG PRYSM_DOCKERFILE ERIGON_SRC_BUILD_TARGET ERIGON_DOCKER_TAG \ - ERIGON_DOCKERFILE MEV_DOCKERFILE MEV_DOCKER_TAG NIMEL_SRC_BUILD_TARGET NIMEL_DOCKER_TAG NIMEL_DOCKERFILE \ - LS_SRC_BUILD_TARGET LS_DOCKER_TAG LS_DOCKERFILE GETH_SRC_BUILD_TARGET GETH_DOCKER_TAG TRAEFIK_TAG DDNS_TAG \ - GETH_DOCKERFILE NM_SRC_BUILD_TARGET NM_DOCKER_TAG NM_DOCKERFILE BESU_SRC_BUILD_TARGET \ - BESU_DOCKER_TAG BESU_DOCKERFILE SSV_NODE_TAG SSV2_NODE_TAG DEPCLI_SRC_BUILD_TARGET DEPCLI_DOCKER_TAG W3S_DOCKER_TAG \ - PG_DOCKER_TAG RETH_SRC_BUILD_TARGET RETH_DOCKER_TAG RETH_DOCKERFILE NODE_EXPORTER_IGNORE_MOUNT_REGEX ) + TARGET_VARS=( NIM_SRC_BUILD_TARGET NIM_SRC_REPO NIM_DOCKER_TAG NIM_DOCKER_VC_TAG NIM_DOCKER_REPO NIM_DOCKER_VC_REPO NIM_DOCKERFILE \ + TEKU_SRC_BUILD_TARGET TEKU_SRC_REPO TEKU_DOCKER_TAG TEKU_DOCKER_REPO TEKU_DOCKERFILE LH_SRC_BUILD_TARGET LH_SRC_REPO \ + LH_DOCKER_TAG LH_DOCKER_REPO LH_DOCKERFILE PRYSM_SRC_BUILD_TARGET PRYSM_SRC_REPO PRYSM_DOCKER_TAG PRYSM_DOCKER_VC_TAG \ + PRYSM_DOCKER_REPO PRYSM_DOCKER_VC_REPO PRYSM_DOCKERFILE ERIGON_SRC_BUILD_TARGET ERIGON_SRC_REPO ERIGON_DOCKER_TAG \ + ERIGON_DOCKER_REPO ERIGON_DOCKERFILE MEV_DOCKERFILE MEV_DOCKER_TAG MEV_DOCKER_REPO NIMEL_SRC_BUILD_TARGET NIMEL_SRC_REPO \ + NIMEL_DOCKER_TAG NIMEL_DOCKER_REPO NIMEL_DOCKERFILE LS_SRC_BUILD_TARGET LS_SRC_REPO LS_DOCKER_TAG LS_DOCKER_REPO LS_DOCKERFILE \ + GETH_SRC_BUILD_TARGET GETH_SRC_REPO GETH_DOCKER_TAG GETH_DOCKER_REPO TRAEFIK_TAG DDNS_TAG GETH_DOCKERFILE NM_SRC_BUILD_TARGET \ + NM_SRC_REPO NM_DOCKER_TAG NM_DOCKER_REPO NM_DOCKERFILE BESU_SRC_BUILD_TARGET BESU_SRC_REPO BESU_DOCKER_TAG BESU_DOCKER_REPO \ + BESU_DOCKERFILE SSV_NODE_TAG SSV2_NODE_TAG DEPCLI_SRC_BUILD_TARGET DEPCLI_SRC_REPO DEPCLI_DOCKER_TAG W3S_DOCKER_TAG W3S_DOCKER_REPO \ + PG_DOCKER_TAG RETH_SRC_BUILD_TARGET RETH_SRC_REPO RETH_DOCKER_TAG RETH_DOCKER_REPO RETH_DOCKERFILE NODE_EXPORTER_IGNORE_MOUNT_REGEX ) OLD_VARS=( LH_PORT PRYSM_WEB_PORT EC_NODE REWARDS_TO GETH_CACHE CF_API_TOKEN \ EC_HOST EC_LB EC_WS_HOST EC_WS_LB CC_HOST CC_LB EC_P2P_PORT CC_NODE CC_P2P_PORT EC_RPC_PORT EC_WS_PORT ) NEW_VARS=( CL_P2P_PORT KEY_API_PORT EL_NODE FEE_RECIPIENT EL_EXTRAS CF_DNS_API_TOKEN \ diff --git a/flashbots/Dockerfile.binary b/flashbots/Dockerfile.binary index 23f1bc50..95c5fca5 100644 --- a/flashbots/Dockerfile.binary +++ b/flashbots/Dockerfile.binary @@ -1,5 +1,6 @@ ARG DOCKER_TAG -FROM flashbots/mev-boost:${DOCKER_TAG} as mev +ARG DOCKER_REPO +FROM ${DOCKER_REPO}:${DOCKER_TAG} ARG USER=mev ARG UID=10666 diff --git a/geth.yml b/geth.yml index 19244caa..179c0b80 100644 --- a/geth.yml +++ b/geth.yml @@ -14,8 +14,10 @@ services: context: ./geth dockerfile: ${GETH_DOCKERFILE} args: - - BUILD_TARGET=${GETH_SRC_BUILD_TARGET} - - DOCKER_TAG=${GETH_DOCKER_TAG} + - BUILD_TARGET=${GETH_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${GETH_SRC_REPO:-https://github.com/ethereum/go-ethereum} + - DOCKER_TAG=${GETH_DOCKER_TAG:-stable} + - DOCKER_REPO=${GETH_DOCKER_REPO:-ethereum/client-go} stop_grace_period: 5m image: geth:local user: geth diff --git a/geth/Dockerfile.binary b/geth/Dockerfile.binary index 6c34f96b..baa7652a 100644 --- a/geth/Dockerfile.binary +++ b/geth/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM ethereum/client-go:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Unused, this is here to avoid build time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=geth ARG UID=10001 diff --git a/geth/Dockerfile.source b/geth/Dockerfile.source index 15174bf5..d3932ec7 100644 --- a/geth/Dockerfile.source +++ b/geth/Dockerfile.source @@ -3,13 +3,15 @@ FROM golang:1.21-alpine as builder # Unused, this is here to avoid build time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apk update && apk add --no-cache make gcc musl-dev linux-headers git bash WORKDIR /src -RUN bash -c "git clone https://github.com/ethereum/go-ethereum.git && cd go-ethereum && git config advice.detachedHead false && git fetch --all --tags && \ +RUN bash -c "git clone ${SRC_REPO} go-ethereum && cd go-ethereum && git config advice.detachedHead false && git fetch --all --tags && \ if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:geth-pr; git checkout geth-pr; else git checkout ${BUILD_TARGET}; fi && \ go run build/ci.go install -static" diff --git a/lighthouse-cl-only.yml b/lighthouse-cl-only.yml index 96b7f161..715c17f1 100644 --- a/lighthouse-cl-only.yml +++ b/lighthouse-cl-only.yml @@ -11,8 +11,10 @@ x-build: &lh-build context: ./lighthouse dockerfile: ${LH_DOCKERFILE} args: - - BUILD_TARGET=${LH_SRC_BUILD_TARGET} - - DOCKER_TAG=${LH_DOCKER_TAG} + - BUILD_TARGET=${LH_SRC_BUILD_TARGET:-stable} + - SRC_REPO=${LH_SRC_REPO:-https://github.com/sigp/lighthouse} + - DOCKER_TAG=${LH_DOCKER_TAG:-latest-modern} + - DOCKER_REPO=${LH_DOCKER_REPO:-sigp/lighthouse} services: consensus: diff --git a/lighthouse-vc-only.yml b/lighthouse-vc-only.yml index 4bf7c6fb..9dbeeb7d 100644 --- a/lighthouse-vc-only.yml +++ b/lighthouse-vc-only.yml @@ -11,8 +11,10 @@ x-build: &lh-build context: ./lighthouse dockerfile: ${LH_DOCKERFILE} args: - - BUILD_TARGET=${LH_SRC_BUILD_TARGET} - - DOCKER_TAG=${LH_DOCKER_TAG} + - BUILD_TARGET=${LH_SRC_BUILD_TARGET:-stable} + - SRC_REPO=${LH_SRC_REPO:-https://github.com/sigp/lighthouse} + - DOCKER_TAG=${LH_DOCKER_TAG:-latest-modern} + - DOCKER_REPO=${LH_DOCKER_REPO:-sigp/lighthouse} services: validator: diff --git a/lighthouse.yml b/lighthouse.yml index 011d6c6b..05f8c60a 100644 --- a/lighthouse.yml +++ b/lighthouse.yml @@ -12,8 +12,10 @@ x-build: &lh-build context: ./lighthouse dockerfile: ${LH_DOCKERFILE} args: - - BUILD_TARGET=${LH_SRC_BUILD_TARGET} - - DOCKER_TAG=${LH_DOCKER_TAG} + - BUILD_TARGET=${LH_SRC_BUILD_TARGET:-stable} + - SRC_REPO=${LH_SRC_REPO:-https://github.com/sigp/lighthouse} + - DOCKER_TAG=${LH_DOCKER_TAG:-latest-modern} + - DOCKER_REPO=${LH_DOCKER_REPO:-sigp/lighthouse} services: consensus: diff --git a/lighthouse/Dockerfile.binary b/lighthouse/Dockerfile.binary index 2868e076..e46f3a85 100644 --- a/lighthouse/Dockerfile.binary +++ b/lighthouse/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM sigp/lighthouse:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Unused, this is here to avoid build time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=lhconsensus ARG UID=10002 diff --git a/lighthouse/Dockerfile.source b/lighthouse/Dockerfile.source index e439f4fe..cd4a8357 100644 --- a/lighthouse/Dockerfile.source +++ b/lighthouse/Dockerfile.source @@ -1,28 +1,21 @@ # Build Lighthouse in a stock Rust build container FROM rust:bookworm as builder -# mallinfo2 is useful for memory troubleshooting but requires glibc 2.33. Debian Bullseye ships with 2.31 -#FROM ubuntu:jammy as builder + +# Unused, this is here to avoid build time complaints +ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO ENV FEATURES modern,gnosis,slasher-lmdb,jemalloc RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y cmake libclang-dev protobuf-compiler -# Need a bit more in Ubuntu -#RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y cmake libclang-dev build-essential git curl protobuf-compiler - -#RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y -#ENV PATH="/root/.cargo/bin:${PATH}" WORKDIR /usr/src -RUN bash -c "git clone https://github.com/sigp/lighthouse.git && cd lighthouse && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:lh-pr; git checkout lh-pr; else git checkout ${BUILD_TARGET}; fi && CROSS_PROFILE=maxperf make" +RUN bash -c "git clone ${SRC_REPO} lighthouse && cd lighthouse && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:lh-pr; git checkout lh-pr; else git checkout ${BUILD_TARGET}; fi && CROSS_PROFILE=maxperf make" # Pull all binaries into a second stage deploy debian container FROM debian:bookworm-slim -# mallinfo2 is useful for memory troubleshooting but requires glibc 2.33. Debian Bullseye ships with 2.31 -#FROM ubuntu:jammy - -# Unused, this is here to avoid build time complaints -ARG DOCKER_TAG RUN set -eux; \ apt-get update; \ diff --git a/lodestar-cl-only.yml b/lodestar-cl-only.yml index cc05eddc..401e9568 100644 --- a/lodestar-cl-only.yml +++ b/lodestar-cl-only.yml @@ -11,8 +11,10 @@ x-build: &ls-build context: ./lodestar dockerfile: ${LS_DOCKERFILE} args: - - BUILD_TARGET=${LS_SRC_BUILD_TARGET} - - DOCKER_TAG=${LS_DOCKER_TAG} + - BUILD_TARGET=${LS_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${LS_SRC_REPO:-https://github.com/ChainSafe/lodestar} + - DOCKER_TAG=${LS_DOCKER_TAG:-latest} + - DOCKER_REPO=${LS_DOCKER_REPO:-chainsafe/lodestar} services: consensus: diff --git a/lodestar-vc-only.yml b/lodestar-vc-only.yml index c08ce114..8c1eba33 100644 --- a/lodestar-vc-only.yml +++ b/lodestar-vc-only.yml @@ -11,8 +11,10 @@ x-build: &ls-build context: ./lodestar dockerfile: ${LS_DOCKERFILE} args: - - BUILD_TARGET=${LS_SRC_BUILD_TARGET} - - DOCKER_TAG=${LS_DOCKER_TAG} + - BUILD_TARGET=${LS_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${LS_SRC_REPO:-https://github.com/ChainSafe/lodestar} + - DOCKER_TAG=${LS_DOCKER_TAG:-latest} + - DOCKER_REPO=${LS_DOCKER_REPO:-chainsafe/lodestar} services: validator: diff --git a/lodestar.yml b/lodestar.yml index 4126067d..3d190d4f 100644 --- a/lodestar.yml +++ b/lodestar.yml @@ -11,8 +11,10 @@ x-build: &ls-build context: ./lodestar dockerfile: ${LS_DOCKERFILE} args: - - BUILD_TARGET=${LS_SRC_BUILD_TARGET} - - DOCKER_TAG=${LS_DOCKER_TAG} + - BUILD_TARGET=${LS_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${LS_SRC_REPO:-https://github.com/ChainSafe/lodestar} + - DOCKER_TAG=${LS_DOCKER_TAG:-latest} + - DOCKER_REPO=${LS_DOCKER_REPO:-chainsafe/lodestar} services: consensus: diff --git a/lodestar/Dockerfile.binary b/lodestar/Dockerfile.binary index 51b5fef5..6b7476b4 100644 --- a/lodestar/Dockerfile.binary +++ b/lodestar/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM chainsafe/lodestar:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Here only to avoid build-time errors ARG BUILD_TARGET +ARG SRC_REPO RUN apk update && apk add --no-cache ca-certificates tzdata bash su-exec git && rm -rf /var/cache/apk/* diff --git a/lodestar/Dockerfile.source b/lodestar/Dockerfile.source index 8731b126..c6bb04d4 100644 --- a/lodestar/Dockerfile.source +++ b/lodestar/Dockerfile.source @@ -2,15 +2,17 @@ FROM node:20-alpine as build # Here only to avoid build-time errors ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apk update && apk add --no-cache git g++ make python3 bash && rm -rf /var/cache/apk/* #RUN ln -s /usr/bin/python3 /usr/bin/python WORKDIR /usr/app -RUN bash -c "cd .. && rm -rf app && git clone https://github.com/ChainSafe/lodestar.git app && cd app && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:ls-pr; git checkout ls-pr; else git checkout ${BUILD_TARGET}; fi && yarn install --non-interactive --frozen-lockfile && yarn build" +RUN bash -c "cd .. && rm -rf app && git clone ${SRC_REPO} app && cd app && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:ls-pr; git checkout ls-pr; else git checkout ${BUILD_TARGET}; fi && yarn install --non-interactive --frozen-lockfile && yarn build" FROM node:20-alpine diff --git a/mev-boost.yml b/mev-boost.yml index 415b58bf..9e67d233 100644 --- a/mev-boost.yml +++ b/mev-boost.yml @@ -14,7 +14,8 @@ services: context: ./flashbots dockerfile: ${MEV_DOCKERFILE} args: - - DOCKER_TAG=${MEV_DOCKER_TAG} + - DOCKER_TAG=${MEV_DOCKER_TAG:-latest} + - DOCKER_REPO=${MEV_DOCKER_REPO:-flashbots/mev-boost} image: mev-boost:local entrypoint: - /app/mev-boost diff --git a/nethermind.yml b/nethermind.yml index ba9dfc6c..3918cda8 100644 --- a/nethermind.yml +++ b/nethermind.yml @@ -16,8 +16,10 @@ services: context: ./nethermind dockerfile: ${NM_DOCKERFILE} args: - - BUILD_TARGET=${NM_SRC_BUILD_TARGET} - - DOCKER_TAG=${NM_DOCKER_TAG} + - BUILD_TARGET=${NM_SRC_BUILD_TARGET:-'$(git tag --sort=-committerdate | grep -E "^[0-9]+[.][0-9]+[.][0-9]+$" | head -1)'} + - SRC_REPO=${NM_SRC_REPO:-https://github.com/NethermindEth/nethermind} + - DOCKER_TAG=${NM_DOCKER_TAG:-latest} + - DOCKER_REPO=${NM_DOCKER_REPO:-nethermind/nethermind} image: nethermind:local user: nethermind environment: diff --git a/nethermind/Dockerfile.binary b/nethermind/Dockerfile.binary index cbb1d835..324d200e 100644 --- a/nethermind/Dockerfile.binary +++ b/nethermind/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM nethermind/nethermind:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Unused, this is here to avoid build time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=nethermind ARG UID=10001 diff --git a/nethermind/Dockerfile.source b/nethermind/Dockerfile.source index ab8baf06..f1f0886f 100644 --- a/nethermind/Dockerfile.source +++ b/nethermind/Dockerfile.source @@ -2,14 +2,16 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build # Unused, this is here to avoid build time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO WORKDIR / RUN apt-get update -y && apt-get install -y git RUN bash -c "\ - git clone https://github.com/NethermindEth/nethermind && \ + git clone ${SRC_REPO} nethermind && \ cd nethermind && \ git config advice.detachedHead false && \ git fetch --all --tags && \ diff --git a/nimbus-cl-only.yml b/nimbus-cl-only.yml index 78fb1dc9..b5d37cba 100644 --- a/nimbus-cl-only.yml +++ b/nimbus-cl-only.yml @@ -11,9 +11,12 @@ x-build: &nimbus-build context: ./nimbus dockerfile: ${NIM_DOCKERFILE} args: - - BUILD_TARGET=${NIM_SRC_BUILD_TARGET} - - DOCKER_TAG=${NIM_DOCKER_TAG} - - DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG} + - BUILD_TARGET=${NIM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${NIM_SRC_REPO:-https://github.com/status-im/nimbus-eth2} + - DOCKER_TAG=${NIM_DOCKER_TAG:-multiarch-latest} + - DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG:-multiarch-latest} + - DOCKER_REPO=${NIM_DOCKER_REPO:-statusim/nimbus-eth2} + - DOCKER_VC_REPO=${NIM_DOCKER_VC_REPO:-statusim/nimbus-validator-client} services: consensus: diff --git a/nimbus-el.yml b/nimbus-el.yml index c0b96549..f047f9ac 100644 --- a/nimbus-el.yml +++ b/nimbus-el.yml @@ -14,8 +14,10 @@ services: context: ./nimbus-el dockerfile: ${NIMEL_DOCKERFILE} args: - - BUILD_TARGET=${NIMEL_SRC_BUILD_TARGET} - - DOCKER_TAG=${NIMEL_DOCKER_TAG} + - BUILD_TARGET=${NIMEL_SRC_BUILD_TARGET:-master} + - SRC_REPO=${NIMEL_SRC_REPO:-https://github.com/status-im/nimbus-eth1} + - DOCKER_TAG=${NIMEL_DOCKER_TAG:-nonesuch} + - DOCKER_REPO=${NIMEL_DOCKER_REPO:-nonesuch} stop_grace_period: 5m stop_signal: SIGINT image: nimbus-el:local diff --git a/nimbus-el/Dockerfile.source b/nimbus-el/Dockerfile.source index 30d43232..ac89c735 100644 --- a/nimbus-el/Dockerfile.source +++ b/nimbus-el/Dockerfile.source @@ -3,14 +3,16 @@ FROM debian:bookworm-slim as builder # Included here to avoid build-time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y build-essential git ca-certificates librocksdb-dev WORKDIR /usr/src -RUN bash -c "git clone https://github.com/status-im/nimbus-eth1 && cd nimbus-eth1 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make update && make -j$(nproc) nimbus" +RUN bash -c "git clone ${SRC_REPO} nimbus-eth1 && cd nimbus-eth1 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make update && make -j$(nproc) nimbus" # Pull all binaries into a second stage deploy debian container FROM debian:bookworm-slim diff --git a/nimbus-vc-only.yml b/nimbus-vc-only.yml index 54333c17..920f45bf 100644 --- a/nimbus-vc-only.yml +++ b/nimbus-vc-only.yml @@ -11,9 +11,12 @@ x-build: &nimbus-build context: ./nimbus dockerfile: ${NIM_DOCKERFILE} args: - - BUILD_TARGET=${NIM_SRC_BUILD_TARGET} - - DOCKER_TAG=${NIM_DOCKER_TAG} - - DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG} + - BUILD_TARGET=${NIM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${NIM_SRC_REPO:-https://github.com/status-im/nimbus-eth2} + - DOCKER_TAG=${NIM_DOCKER_TAG:-multiarch-latest} + - DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG:-multiarch-latest} + - DOCKER_REPO=${NIM_DOCKER_REPO:-statusim/nimbus-eth2} + - DOCKER_VC_REPO=${NIM_DOCKER_VC_REPO:-statusim/nimbus-validator-client} services: validator: diff --git a/nimbus.yml b/nimbus.yml index 06d4cc06..8116c24c 100644 --- a/nimbus.yml +++ b/nimbus.yml @@ -11,9 +11,12 @@ x-build: &nimbus-build context: ./nimbus dockerfile: ${NIM_DOCKERFILE} args: - - BUILD_TARGET=${NIM_SRC_BUILD_TARGET} - - DOCKER_TAG=${NIM_DOCKER_TAG} - - DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG} + - BUILD_TARGET=${NIM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${NIM_SRC_REPO:-https://github.com/status-im/nimbus-eth2} + - DOCKER_TAG=${NIM_DOCKER_TAG:-multiarch-latest} + - DOCKER_VC_TAG=${NIM_DOCKER_VC_TAG:-multiarch-latest} + - DOCKER_REPO=${NIM_DOCKER_REPO:-statusim/nimbus-eth2} + - DOCKER_VC_REPO=${NIM_DOCKER_VC_REPO:-statusim/nimbus-validator-client} services: consensus: diff --git a/nimbus/Dockerfile.binary b/nimbus/Dockerfile.binary index 9a9c12ce..2816f8ec 100644 --- a/nimbus/Dockerfile.binary +++ b/nimbus/Dockerfile.binary @@ -1,10 +1,13 @@ ARG DOCKER_TAG ARG DOCKER_VC_TAG +ARG DOCKER_REPO +ARG DOCKER_VC_REPO -FROM statusim/nimbus-eth2:${DOCKER_TAG} as consensus +FROM ${DOCKER_REPO}:${DOCKER_TAG} as consensus # Included here to avoid build-time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=user ARG UID=10002 @@ -35,7 +38,7 @@ USER ${USER} ENTRYPOINT ["nimbus_beacon_node"] -FROM statusim/nimbus-validator-client:${DOCKER_VC_TAG} as validator +FROM ${DOCKER_VC_REPO}:${DOCKER_VC_TAG} as validator # Included here to avoid build-time complaints ARG BUILD_TARGET diff --git a/nimbus/Dockerfile.source b/nimbus/Dockerfile.source index 8e5573cb..14e729a9 100644 --- a/nimbus/Dockerfile.source +++ b/nimbus/Dockerfile.source @@ -3,13 +3,17 @@ FROM debian:bookworm-slim as builder # Included here to avoid build-time complaints ARG DOCKER_TAG +ARG DOCKER_VC_TAG +ARG DOCKER_REPO +ARG DOCKER_VC_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y build-essential git ca-certificates WORKDIR /usr/src -RUN bash -c "git clone --recurse-submodules -j8 https://github.com/status-im/nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make -j$(nproc) update && make -j$(nproc) nimbus_beacon_node nimbus_validator_client" +RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make -j$(nproc) update && make -j$(nproc) nimbus_beacon_node nimbus_validator_client" # Pull all binaries into a second stage deploy debian container FROM debian:bookworm-slim as consensus diff --git a/nimbus/Dockerfile.sourcegnosis b/nimbus/Dockerfile.sourcegnosis index 7f55627d..92b2cec4 100644 --- a/nimbus/Dockerfile.sourcegnosis +++ b/nimbus/Dockerfile.sourcegnosis @@ -3,13 +3,17 @@ FROM debian:bookworm-slim as builder # Included here to avoid build-time complaints ARG DOCKER_TAG +ARG DOCKER_VC_TAG +ARG DOCKER_REPO +ARG DOCKER_VC_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y build-essential git ca-certificates WORKDIR /usr/src -RUN bash -c "git clone --recurse-submodules -j8 https://github.com/status-im/nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make -j$(nproc) update && make -j$(nproc) gnosis-build nimbus_validator_client" +RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make -j$(nproc) update && make -j$(nproc) gnosis-build nimbus_validator_client" # Pull all binaries into a second stage deploy debian container FROM debian:bookworm-slim as consensus diff --git a/nimbus/Dockerfile.sourceslottime b/nimbus/Dockerfile.sourceslottime index 3a8bee6b..6cadbac2 100644 --- a/nimbus/Dockerfile.sourceslottime +++ b/nimbus/Dockerfile.sourceslottime @@ -3,14 +3,18 @@ FROM debian:bookworm-slim as builder # Included here to avoid build-time complaints ARG DOCKER_TAG +ARG DOCKER_VC_TAG +ARG DOCKER_REPO +ARG DOCKER_VC_REPO ARG BUILD_TARGET +ARG SRC_REPO ARG SECONDS_PER_SLOT=12 RUN apt-get update && apt-get install -y build-essential git libpcre3-dev ca-certificates WORKDIR /usr/src -RUN bash -c "git clone https://github.com/status-im/nim-beacon-chain && cd nim-beacon-chain && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && \ +RUN bash -c "git clone ${SRC_REPO} nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && \ make -j$(nproc) NIMFLAGS="-d:SECONDS_PER_SLOT=${SECONDS_PER_SLOT}" nimbus_beacon_node" # Pull all binaries into a second stage deploy debian container @@ -44,7 +48,7 @@ RUN adduser \ RUN mkdir -p /var/lib/nimbus && chown ${USER}:${USER} /var/lib/nimbus && chmod 700 /var/lib/nimbus # Cannot assume buildkit, hence no chmod -COPY --from=builder --chown=${USER}:${USER} /usr/src/nim-beacon-chain/build/nimbus_beacon_node /usr/local/bin/nimbus_beacon_node +COPY --from=builder --chown=${USER}:${USER} /usr/src/nimbus-eth2/build/nimbus_beacon_node /usr/local/bin/nimbus_beacon_node COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/ # Belt and suspenders RUN chmod -R 755 /usr/local/bin/* diff --git a/prysm-cl-only.yml b/prysm-cl-only.yml index 72829643..4f1879d4 100644 --- a/prysm-cl-only.yml +++ b/prysm-cl-only.yml @@ -11,9 +11,12 @@ x-build: &prysm-build context: ./prysm dockerfile: ${PRYSM_DOCKERFILE} args: - - BUILD_TARGET=${PRYSM_SRC_BUILD_TARGET} - - DOCKER_TAG=${PRYSM_DOCKER_TAG} - - DOCKER_VC_TAG=${PRYSM_DOCKER_VC_TAG} + - BUILD_TARGET=${PRYSM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${PRYSM_SRC_REPO:-https://github.com/prysmaticlabs/prysm} + - DOCKER_TAG=${PRYSM_DOCKER_TAG:-stable} + - DOCKER_VC_TAG=${PRYSM_DOCKER_VC_TAG:-stable} + - DOCKER_REPO={PRYSM_DOCKER_REPO:-gcr.io/prysmaticlabs/prysm/beacon-chain} + - DOCKER_VC_REPO=${PRYSM_DOCKER_VC_REPO:-gcr.io/prysmaticlabs/prysm/validator} services: consensus: diff --git a/prysm-vc-only.yml b/prysm-vc-only.yml index 961f8f19..fd3c463f 100644 --- a/prysm-vc-only.yml +++ b/prysm-vc-only.yml @@ -11,9 +11,12 @@ x-build: &prysm-build context: ./prysm dockerfile: ${PRYSM_DOCKERFILE} args: - - BUILD_TARGET=${PRYSM_SRC_BUILD_TARGET} - - DOCKER_TAG=${PRYSM_DOCKER_TAG} - - DOCKER_VC_TAG=${PRYSM_DOCKER_VC_TAG} + - BUILD_TARGET=${PRYSM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${PRYSM_SRC_REPO:-https://github.com/prysmaticlabs/prysm} + - DOCKER_TAG=${PRYSM_DOCKER_TAG:-stable} + - DOCKER_VC_TAG=${PRYSM_DOCKER_VC_TAG:-stable} + - DOCKER_REPO={PRYSM_DOCKER_REPO:-gcr.io/prysmaticlabs/prysm/beacon-chain} + - DOCKER_VC_REPO=${PRYSM_DOCKER_VC_REPO:-gcr.io/prysmaticlabs/prysm/validator} services: validator: diff --git a/prysm.yml b/prysm.yml index 3482c16d..593bd4c4 100644 --- a/prysm.yml +++ b/prysm.yml @@ -11,9 +11,12 @@ x-build: &prysm-build context: ./prysm dockerfile: ${PRYSM_DOCKERFILE} args: - - BUILD_TARGET=${PRYSM_SRC_BUILD_TARGET} - - DOCKER_TAG=${PRYSM_DOCKER_TAG} - - DOCKER_VC_TAG=${PRYSM_DOCKER_VC_TAG} + - BUILD_TARGET=${PRYSM_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${PRYSM_SRC_REPO:-https://github.com/prysmaticlabs/prysm} + - DOCKER_TAG=${PRYSM_DOCKER_TAG:-stable} + - DOCKER_VC_TAG=${PRYSM_DOCKER_VC_TAG:-stable} + - DOCKER_REPO={PRYSM_DOCKER_REPO:-gcr.io/prysmaticlabs/prysm/beacon-chain} + - DOCKER_VC_REPO=${PRYSM_DOCKER_VC_REPO:-gcr.io/prysmaticlabs/prysm/validator} services: consensus: diff --git a/prysm/Dockerfile.binary b/prysm/Dockerfile.binary index 0be02dc1..479827ff 100644 --- a/prysm/Dockerfile.binary +++ b/prysm/Dockerfile.binary @@ -1,11 +1,15 @@ ARG DOCKER_TAG ARG DOCKER_VC_TAG -FROM gcr.io/prysmaticlabs/prysm/beacon-chain:${DOCKER_TAG} as ccsource +ARG DOCKER_REPO +ARG DOCKER_VC_REPO + +FROM ${DOCKER_REPO}:${DOCKER_TAG} as clsource FROM debian:bookworm-slim as consensus #Included here to avoid build-time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=prysmconsensus ARG UID=10002 @@ -36,7 +40,7 @@ RUN adduser \ RUN mkdir -p /var/lib/prysm/ee-secret && chown -R ${USER}:${USER} /var/lib/prysm && chmod -R 700 /var/lib/prysm && chmod 777 /var/lib/prysm/ee-secret # Cannot assume buildkit, hence no chmod -COPY --from=ccsource --chown=${USER}:${USER} /app/cmd/beacon-chain/beacon-chain /usr/local/bin/ +COPY --from=clsource --chown=${USER}:${USER} /app/cmd/beacon-chain/beacon-chain /usr/local/bin/ COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/ # Belt and suspenders RUN chmod -R 755 /usr/local/bin/* @@ -45,7 +49,7 @@ USER ${USER} ENTRYPOINT ["beacon-chain"] -FROM gcr.io/prysmaticlabs/prysm/validator:${DOCKER_VC_TAG} as vcsource +FROM ${DOCKER_VC_REPO}:${DOCKER_VC_TAG} as vcsource FROM consensus as validator diff --git a/prysm/Dockerfile.source b/prysm/Dockerfile.source index c1b27081..352483f7 100644 --- a/prysm/Dockerfile.source +++ b/prysm/Dockerfile.source @@ -3,13 +3,17 @@ FROM golang:1.21-bookworm as builder # Here only to avoid build-time errors ARG DOCKER_TAG +ARG DOCKER_VC_TAG +ARG DOCKER_REPO +ARG DOCKER_VC_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y cmake libtinfo5 libgmp-dev npm && npm install -g @bazel/bazelisk && bazel version WORKDIR /go/src -RUN bash -c "git clone https://github.com/prysmaticlabs/prysm.git && cd prysm && git config advice.detachedHead false && git fetch --all --tags && \ +RUN bash -c "git clone ${SRC_REPO} prysm && cd prysm && git config advice.detachedHead false && git fetch --all --tags && \ if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:prysm-pr; git checkout prysm-pr; else git checkout ${BUILD_TARGET}; fi \ && bazel build --config=release //cmd/beacon-chain:beacon-chain && bazel build --config=release //cmd/validator:validator && bazel build --config=release //cmd/client-stats:client-stats" diff --git a/reth.yml b/reth.yml index 792be8c2..cab888e4 100644 --- a/reth.yml +++ b/reth.yml @@ -14,8 +14,10 @@ services: context: ./reth dockerfile: ${RETH_DOCKERFILE} args: - - BUILD_TARGET=${RETH_SRC_BUILD_TARGET} - - DOCKER_TAG=${RETH_DOCKER_TAG} + - BUILD_TARGET=${RETH_SRC_BUILD_TARGET:-main} + - SRC_REPO=${RETH_SRC_REPO:-https://github.com/paradigmxyz/reth} + - DOCKER_TAG=${RETH_DOCKER_TAG:-latest} + - DOCKER_REPO=${RETH_DOCKER_REPO:-ghcr.io/paradigmxyz/reth} stop_grace_period: 5m stop_signal: SIGINT image: reth:local diff --git a/reth/Dockerfile.binary b/reth/Dockerfile.binary index acaad5b3..e67af8f9 100644 --- a/reth/Dockerfile.binary +++ b/reth/Dockerfile.binary @@ -1,8 +1,11 @@ ARG DOCKER_TAG -FROM ghcr.io/paradigmxyz/reth:${DOCKER_TAG} +ARG DOCKER_REPO + +FROM ${DOCKER_REPO}:${DOCKER_TAG} # Unused, this is here to avoid build time complaints ARG BUILD_TARGET +ARG SRC_REPO ARG USER=reth ARG UID=10001 diff --git a/reth/Dockerfile.source b/reth/Dockerfile.source index d284f230..11ed7a48 100644 --- a/reth/Dockerfile.source +++ b/reth/Dockerfile.source @@ -3,13 +3,15 @@ FROM rust:bookworm as builder # Unused, this is here to avoid build time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y libclang-dev WORKDIR /src -RUN bash -c "git clone --recurse-submodules -j8 https://github.com/paradigmxyz/reth.git && cd reth \ +RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} reth && cd reth \ && git config advice.detachedHead false && git fetch --all --tags \ && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:reth-pr; git checkout reth-pr; else git checkout ${BUILD_TARGET}; fi \ && RUSTFLAGS='-C target-cpu=native' cargo build --profile maxperf --features jemalloc" diff --git a/staking-deposit-cli/Dockerfile b/staking-deposit-cli/Dockerfile index 731d428c..b8840407 100644 --- a/staking-deposit-cli/Dockerfile +++ b/staking-deposit-cli/Dockerfile @@ -1,11 +1,12 @@ from python:3.10-bookworm as builder ARG BUILD_TARGET +ARG SRC_REPO RUN mkdir -p /src WORKDIR /src -RUN bash -c "git clone https://github.com/ethereum/staking-deposit-cli.git && cd staking-deposit-cli && git config advice.detachedHead false && git fetch --all --tags \ +RUN bash -c "git clone ${SRC_REPO} staking-deposit-cli && cd staking-deposit-cli && git config advice.detachedHead false && git fetch --all --tags \ && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:deposit-pr; git checkout deposit-pr; else git checkout ${BUILD_TARGET}; fi" FROM python:3.10-alpine diff --git a/teku-cl-only.yml b/teku-cl-only.yml index 993c45ea..0672a5d9 100644 --- a/teku-cl-only.yml +++ b/teku-cl-only.yml @@ -11,8 +11,10 @@ x-build: &teku-build context: ./teku dockerfile: ${TEKU_DOCKERFILE} args: - - BUILD_TARGET=${TEKU_SRC_BUILD_TARGET} - - DOCKER_TAG=${TEKU_DOCKER_TAG} + - BUILD_TARGET=${TEKU_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${TEKU_SRC_REPO:-https://github.com/ConsenSys/teku} + - DOCKER_TAG=${TEKU_DOCKER_TAG:-latest} + - DOCKER_REPO=${TEKU_DOCKER_REPO:-consensys/teku} services: consensus: diff --git a/teku-vc-only.yml b/teku-vc-only.yml index 427e51c0..3ec653ab 100644 --- a/teku-vc-only.yml +++ b/teku-vc-only.yml @@ -11,8 +11,10 @@ x-build: &teku-build context: ./teku dockerfile: ${TEKU_DOCKERFILE} args: - - BUILD_TARGET=${TEKU_SRC_BUILD_TARGET} - - DOCKER_TAG=${TEKU_DOCKER_TAG} + - BUILD_TARGET=${TEKU_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${TEKU_SRC_REPO:-https://github.com/ConsenSys/teku} + - DOCKER_TAG=${TEKU_DOCKER_TAG:-latest} + - DOCKER_REPO=${TEKU_DOCKER_REPO:-consensys/teku} services: validator: diff --git a/teku.yml b/teku.yml index cfc6f2da..63a9484f 100644 --- a/teku.yml +++ b/teku.yml @@ -11,8 +11,10 @@ x-build: &teku-build context: ./teku dockerfile: ${TEKU_DOCKERFILE} args: - - BUILD_TARGET=${TEKU_SRC_BUILD_TARGET} - - DOCKER_TAG=${TEKU_DOCKER_TAG} + - BUILD_TARGET=${TEKU_SRC_BUILD_TARGET:-'$(git describe --tags $(git rev-list --tags --max-count=1))'} + - SRC_REPO=${TEKU_SRC_REPO:-https://github.com/ConsenSys/teku} + - DOCKER_TAG=${TEKU_DOCKER_TAG:-latest} + - DOCKER_REPO=${TEKU_DOCKER_REPO:-consensys/teku} services: consensus: diff --git a/teku/Dockerfile.binary b/teku/Dockerfile.binary index b12a1891..047f28c3 100644 --- a/teku/Dockerfile.binary +++ b/teku/Dockerfile.binary @@ -1,9 +1,11 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM consensys/teku:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} #Next two are unused but included to avoid warnings ARG BUILD_TARGET +ARG SRC_REPO ARG USER=teku ARG UID=10002 diff --git a/teku/Dockerfile.source b/teku/Dockerfile.source index acb5b5c7..c2d2dd36 100644 --- a/teku/Dockerfile.source +++ b/teku/Dockerfile.source @@ -3,13 +3,15 @@ FROM eclipse-temurin:17-jdk-jammy as builder # This is here to avoid build-time complaints ARG DOCKER_TAG +ARG DOCKER_REPO ARG BUILD_TARGET +ARG SRC_REPO RUN apt-get update && apt-get install -y ca-certificates git WORKDIR /usr/src -RUN bash -c "git clone https://github.com/ConsenSys/teku.git \ +RUN bash -c "git clone ${SRC_REPO} teku \ && cd teku \ && git config advice.detachedHead false \ && git fetch --all --tags \ diff --git a/web3signer.yml b/web3signer.yml index 5f3c7ee5..328ab4ef 100644 --- a/web3signer.yml +++ b/web3signer.yml @@ -13,7 +13,8 @@ services: build: context: ./web3signer args: - - DOCKER_TAG=${W3S_DOCKER_TAG} + - DOCKER_TAG=${W3S_DOCKER_TAG:-latest} + - DOCKER_REPO=${W3S_DOCKER_REPO:-consensys/web3signer} dockerfile: Dockerfile.binary image: web3signer:local user: web3signer diff --git a/web3signer/Dockerfile.binary b/web3signer/Dockerfile.binary index 46150143..15610965 100644 --- a/web3signer/Dockerfile.binary +++ b/web3signer/Dockerfile.binary @@ -1,8 +1,9 @@ ARG DOCKER_TAG +ARG DOCKER_REPO -FROM flyway/flyway:9 as flyway +FROM flyway/flyway:latest as flyway -FROM consensys/web3signer:${DOCKER_TAG} +FROM ${DOCKER_REPO}:${DOCKER_TAG} ARG USER=web3signer ARG UID=10000