docker-stellar-core
docker-stellar-core copied to clipboard
The image isn't pulling in my modified configuration
I'm trying to modify the image so that it excludes SELF
as a peer. For example, node1 should only connect to node2 and node3, node2 should only connect to node1 and node3, and node3 should only connect to node1 and node2.
I've modified example/local.env
by making three separate PREFERRED_PEERS
lists. Here it is partially:
node1_POSTGRES_PORT=5441
node1_PEER_PORT=11625
node1_HTTP_PORT=11626
node1_NODE_SEED=SAJEJWKJAOELT2TJPTNLZXXSC3QXHKXDZD6NZLM3B6VQ7G22DQH5TC6C
node1_PREFERRED_PEERS=["127.0.0.1:11635", "127.0.0.1:11645"]
node2_POSTGRES_PORT=5442
node2_PEER_PORT=11635
node2_HTTP_PORT=11636
node2_NODE_SEED=SACTBO4KQ3LYYRRKBST3ZCO24FYRDP2CYN3W5IPP2OTC3NUIKFGZSRRY
node2_PREFERRED_PEERS=["127.0.0.1:11625", "127.0.0.1:11645"]
node3_POSTGRES_PORT=5443
node3_PEER_PORT=11645
node3_HTTP_PORT=11646
node3_NODE_SEED=SCVXYFYE6BQYZD4O6J5ULJXRZYXLMKMXZEI3O3HGTQEB43UOY4XUZV3L
node3_PREFERRED_PEERS=["127.0.0.1:11625", "127.0.0.1:11635"]
Next, in confd
, I modified templates/stellar-core.cfg.tmpl
like this:
PREFERRED_PEERS={{getenv (printf "%s_PREFERRED_PEERS" (getenv "SELF"))}}
However, when I build and run the docker images and look in /etc/confd
(and also /stellar-core.cfg
,) it seems like my changes aren't registered. /etc/confd
contains the original stellar-core.cfg.tmpl
before my modifications.
Here is how I'm building and subsequently running the container:
docker build -t cell:1 --no-cache .
#delete the images first
sudo docker rm -f db1 || true
sudo docker rm -f db2 || true
sudo docker rm -f db3 || true
sudo docker rm -f node1 || true
sudo docker rm -f node2 || true
sudo docker rm -f node3 || true
for N in 1 2; do
# We need to map the ports
peerport=$(($N+1))
echo "$peerport"
sudo docker run --rm --name db$N -p 544$N:5432 --env-file examples/local.env -d stellar/stellar-core-state
sudo docker run --rm --name node$N --volumes-from db$N --env-file examples/local.env -p 116${peerport}5:116${peerport}5 -d stellar/stellar-core /start node$N fresh forcescp
done
for N in 3; do
peerport=$(($N+1))
sudo docker run --rm --name db$N -p 544$N:5432 --env-file examples/local.env -d stellar/stellar-core-state
sudo docker run --rm --name node$N -p 116${peerport}5:116${peerport}5 --volumes-from db$N --env-file examples/local.env -d stellar/stellar-core /start node$N fresh
done
How do I get this docker image to recognize my changes to the stellar-core template, and build a new stellar-core.cfg accordingly?