Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
docker images: add morpho node docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
picnoir committed Nov 19, 2020
1 parent a21c5c9 commit e373f7e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docker/morpho.nix
@@ -0,0 +1,32 @@
{ lib, buildLayeredImage, mkEnv, morpho-node, coreutils, gnused, gnugrep, writeShellScript }:
let run-morpho-node =
writeShellScript "morpho-node" ''
set -exuo pipefail
mkdir -p /tmp
cd "$NOMAD_TASK_DIR"
set +x
echo "waiting for $REQUIRED_PEER_COUNT peers"
until [ "$(jq -e -r < morpho-topology.json '.[] | length')" -ge "$REQUIRED_PEER_COUNT" ]; do
sleep 0.1
done
set -x
exec morpho-checkpoint-node \
--topology "$NOMAD_TASK_DIR"/morpho-topology.json \
--database-path /local/db \
--port "$NOMAD_PORT_morpho" \
--config "$NOMAD_TASK_DIR"/morpho-config.yaml \
--socket-dir "$NOMAD_TASK_DIR/socket" \
"$@"
'';
in {
morpho = buildLayeredImage {
name = "docker.mantis.ws/morpho-node";
config = {
Entrypoint = [ run-morpho-node ];
Env = mkEnv { PATH = lib.makeBinPath [ coreutils gnugrep gnused morpho-node ]; };
};
};
}

0 comments on commit e373f7e

Please sign in to comment.