Skip to content

Commit

Permalink
en: change entrypoint script
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanslwong-crypto-com committed Dec 27, 2024
1 parent 6b5d763 commit 5d8904b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 19 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,37 @@
src = inputs.zksync-era-testnet + /.;
version = "dummy";
};
start = bin:
entrypoint = bin:
writeTextFile {
destination = "/bin/start.sh";
destination = "/usr/bin/entrypoint.sh";
executable = true;
name = "start.sh";
name = "entrypoint.sh";
text = ''
#!${bash}/bin/bash
${sqlx-cli}/bin/sqlx database setup
exec ${bin}/bin/zksync_external_node "$@"
'';
};
generateSecrets = bin:
writeTextFile {
destination = "/configs/generate_secrets.sh";
executable = true;
name = "generate_secrets.sh";
text = ''
#!${bash}/bin/bash
if [ ! -s $1 ]; then
${bin}/bin/zksync_external_node generate-secrets > $1
fi
'';
};
copyToRoot = buildEnv {
name = "image-root";
paths = [
bashInteractive
coreutils
dockerTools.caCertificates
entrypoint
generateSecrets
];
};
in {
Expand All @@ -101,14 +115,14 @@
tag = "nix";
fromImage = base-image-mainnet;
inherit copyToRoot;
config.Entrypoint = ["${start external-node-mainnet}/bin/start.sh"];
config.Entrypoint = ["/usr/bin/entrypoint.sh"];
};
packages.testnet = dockerTools.buildImage {
name = "testnet";
tag = "nix";
fromImage = base-image-testnet;
inherit copyToRoot;
config.Entrypoint = ["${start external-node-testnet}/bin/start.sh"];
config.Entrypoint = ["/usr/bin/entrypoint.sh"];
};
});
}

0 comments on commit 5d8904b

Please sign in to comment.