Skip to content

Commit 5cb68c3

Browse files
committed
Add chia-tools to the image and run if chia. prefixed env is set
1 parent 2783642 commit 5cb68c3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ RUN echo "cloning ${BRANCH}" && \
2424

2525
# Get yq for chia config changes
2626
FROM mikefarah/yq:4 AS yq
27+
# Get chia-tools for a new experimental chia config management strategy
28+
FROM ghcr.io/chia-network/chia-tools:latest AS chia-tools
2729

2830
# IMAGE BUILD
2931
FROM python:3.11-slim
@@ -61,6 +63,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
6163
dpkg-reconfigure -f noninteractive tzdata
6264

6365
COPY --from=yq /usr/bin/yq /usr/bin/yq
66+
COPY --from=chia-tools /chia-tools /chia-tools
6467
COPY --from=chia_build /chia-blockchain /chia-blockchain
6568

6669
ENV PATH=/chia-blockchain/venv/bin:$PATH

docker-entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,12 @@ if [[ ${service} == "harvester" ]]; then
297297
fi
298298
fi
299299

300+
# EXPERIMENTAL!
301+
# If you use any of the chia tools config processing, your config will lose all yaml anchors and be fully expanded out
302+
# Check if any of the env vars start with "chia." or "chia__" and if so, process the config with chia-tools
303+
if env | grep -qE '^chia(\.|__)'; then
304+
echo "Found environment variables starting with 'chia.' or 'chia__' - Running chia-tools"
305+
/chia-tools config edit "$CHIA_ROOT/config/config.yaml"
306+
fi
307+
300308
exec "$@"

0 commit comments

Comments
 (0)