Ansible Docker Container - Clone Private Repo
<p>I am trying to clone a private repository from BitBucket in a Docker container (with Ansible). I just want to try and get this working, so I copied my public and private key into the container. I then run the following (FWICT this is a simplied version on the Ansible command):</p>

<pre><code>docker exec -i web git clone git@bitbucket.org:user/repo.git
</code></pre>

<p>And I get this:</p>

<pre><code>Cloning into 'repo'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
</code></pre>

<p>As a side note, if I run:</p>

<pre><code>docker exec -i -t web git clone git@bitbucket.org:user/repo.git
</code></pre>

<p>I get a TTY and I get prompted for the SSH private key password (can't seem to do this with Ansible) and the repo gets cloned.</p>

<p>So the question is, how can I clone a private repository within a Docker container without <code>-t</code>? Or does anyone know how to clone a private repo in a container with Ansible?</p>