I'm trying to dockerize a flask app with git dependencies in its requirements :
#requirements.txt
git+ssh://git@bitbucket.org/mycompany/myproject.git@develop
So you have to get a valid ssh key to install requirements. Searching on answers, I found one that looks pretty simple with docker compose.
#docker-compose.yml
services:
web:
build: .
command: python manage.py run -h 0.0.0.0
volumes:
....
- $SSH_AUTH_SOCK:/ssh-agent
environment:
SSH_AUTH_SOCK: /ssh-agent
But my build does not work, because it can't pull the repo in the requirements
Host key verification failed.
fatal: Could not read from remote repository.
When i try to ssh-add
in the Dockerfile, another error appears.
Could not open a connection to your authentication agent.
echo $SSH_AUTH_SOCK
on my machine shows this variable is not empty and point to an existing folder.
Am I missing something ? What does "Forwarding ssh agent" do exactly ?