Authenticity of host can't be established docker vs machine

So the virtual machines don’t seem to have any problems with “add_ssh_keys”, but docker has.
Until today I just used machine: enabled: true in my config.yml, but a VM is a bit overkill for me so I tried “downgrading” my setup to a small docker instance. Now with docker, my deployment is ruined. Worst of all, if I don’t cancel the deployment it just keeps running (and so keep using credits) till there is a time out after ten minutes or so:

The authenticity of host '**************** (145.131.3.235)' can't be established.
ECDSA key fingerprint is xx:xx:xx:xx:xx......
Are you sure you want to continue connecting (yes/no)? 

I found a sort of hack, which works, over here Known Hosts in Circle 2.0?, but is there any better solution out there?

Now my config looks something like this:

- add_ssh_keys:
          fingerprints:
            - "xx:xx:xx:xx:xx:xx:xx"
      - run:
          name: Keyscan mydomain.com (HACK)
          command: ssh-keyscan -H mydomain.com >> ~/.ssh/known_hosts