Docker jenkins container, host key verification failed

I’m creating a CI pipeline and development environment with Vagrant, Ansible and Docker. My goal is to have everything automated with a single command, no manual configuration involved. With single ansible-playbook command I should have fully functional continuous deployment pipeline, all the services dockerized.

Now here’s the problem. When I run the official Jenkins docker container and try to configure authentication for git, I get the following error

  • Apache HTTP ProxyPass inside Docker container linked to other containers: Wrong remote IP interpreted by linked container
  • Can (should) Docker be used for winforms applications?
  • Installing tensorflow through docker on Ubuntu 14.04
  • Obtaining the ip address of a docker container
  • Howto link a prestashop docker to an existing mysql server
  • aws ecs perfomance doesn't increase on single instance
  • host key verification failed

    I understand I could login into Jenkins container, ssh to git manually and accept the host key as trusted, when login for the first time. But this is absolute no-no, the connectivity should be handled automatically too.

    How do I configure Jenkins docker container to trust the git server at creation, when the available tools are docker, ansible and vagrant?

  • Getting the latest version of Android SDK for Ubuntu using wget
  • docker-compose up -d error
  • Docker daemon does not start or restart
  • How to run Docker container in it's own network
  • Why is the official SQL Server Express container only meant for development and testing?
  • Auditing in a SQL Server Docker Container
  • One Solution collect form web for “Docker jenkins container, host key verification failed”

    You can use Ansible’s known_hosts module for solving this problem.

    This module adds the host key into the server’s ~/.ssh/known_hosts file, similar to what you describe as a manual step.

    Please note the limitations of the module as well:

    If you have a very large number of host keys to manage, you will find the template module more useful.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.