diff --git a/Dockerfile b/Dockerfile index b712bea..5581e57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,9 @@ RUN apt-get update \ borgbackup \ openssh-client \ && rm -rf /var/lib/apt/lists/* +RUN mkdir -pm0700 "$HOME/.ssh/" \ + && touch "$HOME/.ssh/known_hosts" \ + && chmod 0600 "$HOME/.ssh/known_hosts" +COPY entrypoint.sh /usr/local/bin/ +ENTRYPOINT "entrypoint.sh" CMD ["borg"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..87b89a4 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e + +echo "$SSH_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts" +exec "$@"