diff --git a/Dockerfile b/Dockerfile index 7c79133..d3c17d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,8 @@ RUN echo "cloning ${BRANCH}" && \ # Get yq for chia config changes FROM mikefarah/yq:4 AS yq +# Get chia-tools for a new experimental chia config management strategy +FROM ghcr.io/chia-network/chia-tools:latest AS chia-tools # IMAGE BUILD FROM python:3.11-slim @@ -61,6 +63,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ dpkg-reconfigure -f noninteractive tzdata COPY --from=yq /usr/bin/yq /usr/bin/yq +COPY --from=chia-tools /chia-tools /usr/bin/chia-tools COPY --from=chia_build /chia-blockchain /chia-blockchain ENV PATH=/chia-blockchain/venv/bin:$PATH diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 3a182d3..dd54b2f 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -297,4 +297,12 @@ if [[ ${service} == "harvester" ]]; then fi fi +# EXPERIMENTAL! +# If you use any of the chia tools config processing, your config will lose all yaml anchors and be fully expanded out +# Check if any of the env vars start with "chia." or "chia__" and if so, process the config with chia-tools +if env | grep -qE '^chia(\.|__)'; then + echo "Found environment variables starting with 'chia.' or 'chia__' - Running chia-tools" + /usr/bin/chia-tools config edit "$CHIA_ROOT/config/config.yaml" +fi + exec "$@"