Skip to content

Commit

Permalink
Fix LUKSO config download
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed Aug 8, 2024
1 parent e215dac commit 2d5ecbd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
6 changes: 4 additions & 2 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 16 additions & 9 deletions validator/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit 2d5ecbd

Please sign in to comment.