Generate an id_rsa.pub key (ssh-keygen -t rsa) on your ~/.ssh folder and copy that to the same directory of your Dockerfile.
https://github.com/sciencepal/dockers/tree/master/hadoop_hive_spark_docker/configs https://www.linode.com/docs/databases/hadoop/how-to-install-and-set-up-hadoop-cluster/ https://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication https://stackoverflow.com/questions/38615128/how-to-ssh-from-centos-6-4-into-a-docker-container-without-a-password