Commit 4f1f1ba2af27b73c1ce6de68fb494d65837f5154
1 parent
67d5e607
Exists in
master
modifie entry
Showing
1 changed file
with
5 additions
and
4 deletions
Show diff stats
conf/docker-entrypoint.sh
... | ... | @@ -18,9 +18,10 @@ service apache2 restart |
18 | 18 | #block a tester pour l'accès aux depots privé |
19 | 19 | #fonctionne avec la clé privé ssh (secrets dans docker compose) |
20 | 20 | eval "$(ssh-agent -s)" |
21 | -if [ ! -d "/root/.ssh/" ]; then | |
21 | +if ([ ! -f "/home/dachsroot/.ssh/know_hosts" ] && [ -f "/run/secrets/id_rsa" ]); then | |
22 | 22 | ssh-add -k /run/secrets/id_rsa |
23 | - mkdir /root/.ssh | |
24 | - ssh-keyscan github.com > /root/.ssh/known_hosts | |
25 | - # now execute command which require authentication via ssh (example, git clone from a private repo) | |
23 | + ssh-keyscan github.com >> /home/dachsroot/.ssh/known_hosts | |
24 | + ssh-keyscan gitlab.obpsm.fr >> /home/dachsroot/.ssh/known_hosts | |
25 | + chown dachsroot:gavo /home/dachsroot/.ssh/known_hosts | |
26 | + chmod 600 /home/dachsroot/.ssh/known_hosts | |
26 | 27 | fi | ... | ... |