title: Copy files between two docker containers using scp
body: <p>I have created two docker containers named as server and client using alpine image and I am running both containers.
  Then I installed <code>apk add openssh</code> and <code>apk add openrc</code> in both the containers.
  Using <code>rc-service sshd start</code> I have started the ssh service.
  Now, I want to copy a file using <code>scp</code>.</p>
  <p>From server container I typed:</p>
  <pre><code>scp myfile.txt client@172.17.0.3:/location_of_the_folder
  </code></pre>
  <p>It is asking a password for the client container.
  What can I do?
  What is the default password for docker container(s)?</p>
  <p>I have tried 3 options as follows:</p>
  <ol>
  <li>Attach the same volume to both the containers.</li>
  <li>Using <code>docker cp</code> from server container to host and then host to
  client container.</li>
  <li>Using <code>ssh-keygen</code> in the server container and copied the <code>id_rsa.pub</code>
  key manually to client containers <code>/root/.ssh</code> directory and it works.</li>
  </ol>
  <p>I don't want to use options 1 and 2.
  What should I do for option 3 using shell script? I want to automate this thing.
  I can do it manually, but can we do it by automation using a shell script, to copy some text from one container to another container?</p>