Skip to content
Merged
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
37 changes: 13 additions & 24 deletions nix/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
#
# docker load -i $(nix-build -A dockerImage --no-out-link)
#
# To launch with provided mainnet configuration and persist state in a docker volume run:
# To launch with pre-loaded configuration, using the NETWORK env.
# An example using a docker volume to persist state:
#
# docker run -v /data -e NETWORK=mainnet inputoutput/cardano-node:<TAG>
# docker run -v /data -e NETWORK=mainnet inputoutput/cardano-node
#
# To launch with provided testnet configuration without persisting state run:
# Provide a complete command otherwise:
#
# docker run -e NETWORK=testnet inputoutput/cardano-node:<TAG>
#
# To launch with custom config, mount a dir containing configuration.yaml, genesis.json, and topology.json
#
# docker run -v $PATH_TO/configuration:/configuration \
# inputoutput/cardano-node:<TAG>
# docker run -v $PWD/configuration/defaults/byron-mainnet:/configuration \
# inputoutput/cardano-node run \
# --config /configuration/configuration.yaml \
# --topology /configuration/topology.json \
# --database-path /db
#
# Mount a volume into /ipc for establishing cross-container communication via node.socket
#
# docker run -v node-ipc:/ipc inputoutput/cardano-node:<TAG>
# docker run -v node-ipc:/ipc inputoutput/cardano-node:
# docker run -v node-ipc:/ipc inputoutput/some-node-client
############################################################################

Expand Down Expand Up @@ -85,19 +85,11 @@ let
nodeDockerImage = let
entry-point = writeScriptBin "entry-point" ''
#!${runtimeShell}
echo $NETWORK
if [[ -d /configuration ]]; then
exec ${cardano-node}/bin/cardano-node run \
--config /configuration/configuration.yaml \
--database-path /data/db \
--host-addr 127.0.0.1 \
--port 3001 \
--socket-path /ipc/node.socket \
--topology /configuration/topology.json $@
if [[ -z "$NETWORK" ]]; then
exec ${cardano-node}/bin/cardano-node $@
${clusterStatements}
else
echo "Please set a NETWORK environment variable to one of: mainnet/testnet"
echo "Or mount a /configuration volume containing: configuration.yaml, genesis.json, and topology.json"
echo "Managed configuration for network "$NETWORK" does not exist"
fi
'';
gitrev' = if (gitrev == null)
Expand All @@ -111,9 +103,6 @@ let
contents = [ entry-point ];
config = {
EntryPoint = [ "${entry-point}/bin/entry-point" ];
ExposedPorts = {
"3001/tcp" = {}; # Cardano node p2p
};
};
};

Expand Down