Skip to content

Commit ca31652

Browse files
committed
doc: update the node oci image desc w/ details/examples
1 parent 6c5e2ab commit ca31652

File tree

1 file changed

+64
-12
lines changed

1 file changed

+64
-12
lines changed

Diff for: nix/docker/default.nix

+64-12
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,75 @@
66
# nix build .#dockerImage/node
77
# docker load -i result
88
#
9-
# To launch with pre-loaded configuration, using the NETWORK env.
9+
#
10+
# Scripts Mode:
11+
#
12+
# To launch cardano-node with pre-loaded configuration, "scripts" mode,
13+
# use the NETWORK env variable to declare an existing cardano network name.
14+
#
1015
# An example using a docker volume to persist state:
1116
#
12-
# docker run -v /data -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-node
17+
# docker run -v data:/data -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-node
18+
#
19+
# In "scripts" mode, default state directories include /{data,ipc,logs}, with
20+
# /data/db being the default database state location.
21+
#
22+
#
23+
# Custom Mode:
24+
#
25+
# To launch cardano-node with a custom configuration, "custom" mode, provide
26+
# entrypoint args starting with `run` and:
27+
# * Leave the NETWORK env variable unset,
28+
# * Optionally include additional cardano-node args to the entrypoint afer `run`,
29+
# * Optionally include environment variables interpreted by `nix/docker/context/bin/run-node`
30+
#
31+
# For example, launch a custom cardano-node using cardano-node args and a
32+
# local configuration mapped into the container:
1333
#
14-
# Provide a complete command otherwise:
34+
# docker run \
35+
# -v "$PWD/config/cardano:/config" \
36+
# ghcr.io/intersectmbo/cardano-node \
37+
# run \
38+
# --config /config/mainnet/config.json \
39+
# --topology /config/mainnet/topology.json \
40+
# --database-path /data/db
1541
#
16-
# docker run -v $PWD/configuration/cardano:/configuration \
17-
# ghcr.io/intersectmbo/cardano-node run \
18-
# --config /configuration/mainnet-config.yaml \
19-
# --topology /configuration/mainnet-topology.json \
20-
# --database-path /db
42+
# Custom mode may also leverage standard mainnet or testnet network config
43+
# files found at /opt/cardano/config and organized under a subdirectory of the
44+
# network name. For example, to utilize standard configs for preview network,
45+
# but modify the cardano-node listening port:
2146
#
22-
# Mount a volume into /ipc for establishing cross-container communication via node.socket
47+
# docker run \
48+
# -v "$PWD/preprod-data:/data" \
49+
# -e CARDANO_CONFIG="/opt/cardano/config/preprod/config.json" \
50+
# -e CARDANO_TOPOLOGY="/opt/cardano/config/preprod/topology.json" \
51+
# -e CARDANO_PORT="6001" \
52+
# ghcr.io/intersectmbo/cardano-node \
53+
# run
54+
#
55+
# In "custom" mode, default state directories include
56+
# /opt/cardano/{data,ipc,logs} and with /opt/cardano/data/db being the default
57+
# database state location. Standard network config files can be found under
58+
# /opt/cardano/config.
59+
#
60+
#
61+
# Bind Mounting Considerations:
62+
#
63+
# For "custom" mode, the /opt/cardano/{data,ipc,logs} default state directories have been
64+
# symlinked to the "scripts" mode default state directories of /{data,ipc,logs}
65+
# respectively. This makes bind mounting easier when switching between
66+
# "scripts" and "custom" container modes as bind mounting any of the root
67+
# default state directory locations, /{data,ipc,logs}, will work for both modes.
68+
#
69+
#
70+
# Cardano-node socket sharing:
71+
#
72+
# To share a cardano-node socket with a different container, a volume can be made
73+
# for establishing cross-container communication:
2374
#
2475
# docker run -v node-ipc:/ipc -e NETWORK=mainnet ghcr.io/intersectmbo/cardano-node
2576
# docker run -v node-ipc:/ipc -e NETWORK=mainnet ghcr.io/intersectmbo/some-node-client
77+
#
2678
############################################################################
2779

2880
{ pkgs
@@ -106,15 +158,15 @@ let
106158
context = ./context;
107159

108160
genCfgs = let
109-
environments = lib.getAttrs [ "mainnet" "preprod" "preview" "sanchonet" ] commonLib.environments;
110-
cardano-deployment = commonLib.mkConfigHtml environments;
161+
environments' = lib.getAttrs [ "mainnet" "preprod" "preview" "sanchonet" ] commonLib.environments;
162+
cardano-deployment = commonLib.mkConfigHtml environments';
111163
in
112164
pkgs.runCommand "cardano-html" {} ''
113165
mkdir "$out"
114166
cp "${cardano-deployment}/index.html" "$out/"
115167
cp "${cardano-deployment}/rest-config.json" "$out/"
116168
117-
ENVS=(${lib.escapeShellArgs (builtins.attrNames environments)})
169+
ENVS=(${lib.escapeShellArgs (builtins.attrNames environments')})
118170
for ENV in "''${ENVS[@]}"; do
119171
# Migrate each env from a flat dir to an ENV subdir
120172
mkdir -p "$out/config/$ENV"

0 commit comments

Comments
 (0)