title: Android SDK tools install in Docker fails
body: <p>I am trying to make a docker image that I can use to build Android projects, using Shippable.</p>
  
  <p>The problem is the <code>android update sdk</code> command, which gives the following error:</p>
  
  <pre><code>Installing Android SDK Tools, revision 24.2
    Failed to rename directory /opt/android-sdk-linux/tools to /opt/android-sdk-linux/temp/ToolPackage.old01.
    Failed to create directory /opt/android-sdk-linux/tools
  </code></pre>
  
  <p>I found somewhat of a solution here: <a href="https://stackoverflow.com/a/8839359/867099">https://stackoverflow.com/a/8839359/867099</a> but it's for Windows, and does not seem to fix the problem on linux. It appears that during the update command, the current directory is in use and therefore cannot be renamed.</p>
  
  <p>My workaround sofar, using that workaroundsuggestion, is this:</p>
  
  <pre><code>RUN cp -r /opt/android-sdk-linux/tools /opt/android-sdk-linux/tools_copy
  
  RUN cd /opt/android-sdk-linux/tools &amp;&amp; echo 'y' | /opt/android-sdk-linux/tools_copy/android update sdk --no-ui -a --filter tools,platform-tools,build-tools-22.0.1,android-21,extra-android-support,extra-google-google_play_services --force
  </code></pre>
  
  <p>In order to automatically accept the license, I <code>echo 'y'</code> to the android command.</p>
  
  <p>But I think the <code>android</code> command should also run in the correct directory, which is why I <code>cd</code> into it first. </p>
  
  <p>But, it still fails. I'm rather stumped on how to fix this issue, so any help is appreciated.</p>
  
  <p>------ UPDATE --------</p>
  
  <p>I run the <code>android sdk update</code> command without the <code>tools</code> filter, and in the end, my gradle builds are successful. So I don't know for sure whether it's a problem to not update them...</p>