From 66b22a64f8e8990f9e4625bd70acfc1833f894b2 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 29 Mar 2022 18:50:48 +0100 Subject: [PATCH] Update the entrypoint --- docker-entrypoint.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8a61f1a..c46e073 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,19 @@ #!/bin/sh +ARCH=$(uname -m) +BIN_DIR=/app/linux-${ARCH} +DATA_DIR=/etc/nebula + +# --------------------- TESTING ONLY ------------------------ +# Build certs if they don't exist +if ! test -f ${DATA_DIR}/ca.key; then + cd ${DATA_DIR} || exit 1 + "${BIN_DIR}/nebula-cert" ca -name "Infranet" + "${BIN_DIR}/nebula-cert" sign -name "lighthouse" -ip "10.10.100.1/24" + mv lighthouse.crt host.crt + mv lighthouse.key host.key +fi +# ----------------------------------------------------------- + # Run the platform-specific binary -"/app/linux-$(uname -m)/nebula" +"${BIN_DIR}/nebula" -config ${DATA_DIR}/config.yaml