Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing the process for the entrypoint.sh script #1798

Merged
merged 3 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/docker/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@
1) `--entrypoint=bash` # This option won't start the node's container but only the OS running (the node software wont actually start, you'll need to manually execute entrypoint.sh ), ready to get in (trough the command ``` docker exec -it < container name or hash > /bin/bash ```) and play/explore around with it in command line mode.
2) all guild tools env variable can be used to start a new container using custom values by using the "-e" option.
3) CPU and RAM and Shared Memory allocation option for the container can be used when you start the container (i.e. --shm-size or --memory or --cpus [official docker resource docs](https://docs.docker.com/config/containers/resource_constraints/))
4) `--env MITHRIL_DOWNLOAD=Y` # This option will allow Mithril client to download the latest Mithril snapshot of the blockchain when the container starts and does not have a copy of the blockchain yet. This is useful when you want to start a new node from scratch and don't want to wait for the node to sync from the network. This option is only available for the mainnet, preprod, and preview networks.
4) `--env MITHRIL_DOWNLOAD=Y` # This option will allow Mithril client to download the latest Mithril snapshot of the blockchain when the container starts and does not have a copy of the blockchain yet. This is useful when you want to start a new node from scratch and don't want to wait for the node to sync from the network. This option is not currently available for the guild network.
5) `--env ENTRYPOINT_PROCESS=mithril-signer.sh` # This option will allow the container to start the Mithril signer process instead of the node process. This is useful when you want to run a Mithril signer node and have the container setup the configuration files based on the NETWORK environment varaible.
7 changes: 5 additions & 2 deletions files/docker/node/addons/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ head -n 8 ~/.scripts/banner.txt
# shellcheck disable=SC1090
. ~/.bashrc > /dev/null 2>&1

echo "NETWORK: $NETWORK $POOL_NAME $TOPOLOGY";
[[ -z "${ENTRYPOINT_PROCESS}" ]] && export ENTRYPOINT_PROCESS=cnode.sh

echo "NETWORK: $NETWORK $POOL_NAME $TOPOLOGY"
echo "ENTRYPOINT_PROCESS: $ENTRYPOINT_PROCESS"

[[ -z "${CNODE_HOME}" ]] && export CNODE_HOME=/opt/cardano/cnode
[[ -z "${CNODE_PORT}" ]] && export CNODE_PORT=6000
Expand Down Expand Up @@ -61,4 +64,4 @@ else
fi

customise \
&& exec "$CNODE_HOME"/scripts/cnode.sh
&& exec "$CNODE_HOME/scripts/$ENTRYPOINT_PROCESS" "$@"