From 17bbc35df4231512104ff5da06136a12a9bdb288 Mon Sep 17 00:00:00 2001 From: John Internet Date: Thu, 2 Jan 2020 21:02:22 +0000 Subject: [PATCH] Add an autostart, for autoloading from the "ssh_private_key" env var. --- Dockerfile | 2 +- agent-autostart | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 agent-autostart diff --git a/Dockerfile b/Dockerfile index 6fb17c6..12ac8f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN rm -rf /var/cache/apk/* RUN mkdir ~/.ssh # Copy in our executables. -COPY agent-start agent-stop agent-add /bin/ +COPY agent-start agent-stop agent-add agent-autostart /bin/ COPY hosts-clear hosts-add /bin/ RUN chmod +x /bin/agent-* /bin/hosts-* diff --git a/agent-autostart b/agent-autostart new file mode 100644 index 0000000..3b983bf --- /dev/null +++ b/agent-autostart @@ -0,0 +1,4 @@ +#!/bin/sh + +source agent-start +echo "$SSH_PRIVATE_KEY" | agent-add \ No newline at end of file