From 4f1f1ba2af27b73c1ce6de68fb494d65837f5154 Mon Sep 17 00:00:00 2001 From: Philippe Hamy Date: Tue, 24 Nov 2020 16:43:34 +0100 Subject: [PATCH] modifie entry --- conf/docker-entrypoint.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/docker-entrypoint.sh b/conf/docker-entrypoint.sh index f719a3b..6a76ed4 100644 --- a/conf/docker-entrypoint.sh +++ b/conf/docker-entrypoint.sh @@ -18,9 +18,10 @@ service apache2 restart #block a tester pour l'accès aux depots privé #fonctionne avec la clé privé ssh (secrets dans docker compose) eval "$(ssh-agent -s)" -if [ ! -d "/root/.ssh/" ]; then +if ([ ! -f "/home/dachsroot/.ssh/know_hosts" ] && [ -f "/run/secrets/id_rsa" ]); then ssh-add -k /run/secrets/id_rsa - mkdir /root/.ssh - ssh-keyscan github.com > /root/.ssh/known_hosts - # now execute command which require authentication via ssh (example, git clone from a private repo) + ssh-keyscan github.com >> /home/dachsroot/.ssh/known_hosts + ssh-keyscan gitlab.obpsm.fr >> /home/dachsroot/.ssh/known_hosts + chown dachsroot:gavo /home/dachsroot/.ssh/known_hosts + chmod 600 /home/dachsroot/.ssh/known_hosts fi -- libgit2 0.21.2