title: Dockerfile to add ssh key of container and host
body: <p>I want to make a container ssh into the host without asking for the password. For this, I need to save the ssh key. I have following dockerfile:</p>
  
  <pre><code>FROM easypi/alpine-arm
  
  RUN apk update &amp;&amp; apk upgrade
  
  RUN apk add openssh
  RUN ssh-keygen -f /root/.ssh/id_rsa
  RUN ssh-copy-id -i /root/.ssh/id_rsa user@&lt;ipadress of host&gt;
  </code></pre>
  
  <p>But the problem is the ip address is not constant. So if I use the same image on some other machine, it wont work there. How can I resolve this issue.</p>
  
  <p>Thanks</p>