From 2d5ecbdeccd405cc5b54a7ffaf8829af881827f5 Mon Sep 17 00:00:00 2001 From: dappnodedev Date: Thu, 8 Aug 2024 12:12:12 +0200 Subject: [PATCH] Fix LUKSO config download --- beacon-chain/Dockerfile | 6 ++++-- validator/Dockerfile | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/beacon-chain/Dockerfile b/beacon-chain/Dockerfile index 0360ed0..a228793 100644 --- a/beacon-chain/Dockerfile +++ b/beacon-chain/Dockerfile @@ -4,8 +4,10 @@ FROM debian:bullseye-slim AS builder ARG NETWORK # Use ldd to copy dependencies of grep -RUN mkdir /deps -RUN ldd /bin/grep | tr -s '[:space:]' '\n' | grep '^/' | xargs -I {} cp -v {} /deps || true +RUN mkdir /deps && \ + ldd /bin/grep | tr -s '[:space:]' '\n' | grep '^/' | xargs -I {} cp -v {} /deps || true && \ + apt-get update && \ + apt-get --yes install wget ENV LUKSO_CONFIG_PATH=/configs/lukso \ LUKSO_SHARED_CONFIG_URL=https://raw.githubusercontent.com/lukso-network/network-configs/main/mainnet/shared diff --git a/validator/Dockerfile b/validator/Dockerfile index 7fcdf15..69654f9 100644 --- a/validator/Dockerfile +++ b/validator/Dockerfile @@ -1,9 +1,21 @@ ARG UPSTREAM_VERSION + FROM debian:bullseye-slim AS builder +ARG NETWORK + # Use ldd to copy dependencies of grep RUN mkdir /deps -RUN ldd /bin/grep | tr -s '[:space:]' '\n' | grep '^/' | xargs -I {} cp -v {} /deps || true +RUN ldd /bin/grep | tr -s '[:space:]' '\n' | grep '^/' | xargs -I {} cp -v {} /deps || true && \ + apt-get update && \ + apt-get --yes install wget && \ + apt-get clean + +ENV LUKSO_CONFIG_URL=https://raw.githubusercontent.com/lukso-network/network-configs/main/mainnet/shared/config.yaml + +RUN if [ "${NETWORK}" = "lukso" ]; then \ + wget ${LUKSO_CONFIG_URL} -O /lukso-config.yaml; \ + fi ARG UPSTREAM_VERSION FROM gcr.io/prysmaticlabs/prysm/validator:${UPSTREAM_VERSION} @@ -16,14 +28,14 @@ ENV VALIDATOR_API_PORT=3500 \ DATA_DIR=${DATA_DIR} \ WALLET_DIR=${DATA_DIR}/prysm-wallet-v2 \ LUKSO_CONFIG_PATH=/configs/lukso/shared/config.yaml \ - STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION} \ - LUKSO_CONFIG_URL=https://raw.githubusercontent.com/lukso-network/network-configs/main/mainnet/shared/config.yaml + STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION} COPY --from=builder /bin/sh /bin/sh COPY --from=builder /bin/grep /bin/grep COPY --from=builder /deps/* /lib/ +COPY --from=builder /lukso-config.yaml ${LUKSO_CONFIG_PATH} -RUN mkdir -p ${WALLET_DIR} +RUN mkdir -p ${WALLET_DIR} $(dirname ${LUKSO_CONFIG_PATH}) COPY auth-token ${WALLET_DIR}/auth-token COPY entrypoint.sh /usr/local/bin/entrypoint.sh @@ -32,11 +44,6 @@ ADD ${STAKER_SCRIPTS_URL}/consensus_tools.sh /etc/profile.d/ RUN chmod +rx /usr/local/bin/entrypoint.sh /etc/profile.d/consensus_tools.sh -RUN if [ "${NETWORK}" = "lukso" ]; then \ - mkdir -p $(dirname ${LUKSO_CONFIG_PATH}) && \ - wget ${LUKSO_CONFIG_URL} -O ${LUKSO_CONFIG_PATH}; \ - fi - # This env changes the variant # Placed at the end to regenerate the least amount of layers ENV NETWORK=${NETWORK}