title: Flutter installation on Alpine Linux container is unable to 'pub upgrade'
body: <p>I would like to install Flutter on a Docker container running Alpine Linux.</p>
  <p>I wrote the following <code>Dockerfile</code>:</p>
  <pre><code>FROM alpine
  
  RUN apk add bash curl file git zip
  RUN git clone https://github.com/flutter/flutter.git
  ENV PATH=&quot;$PATH:/flutter/bin&quot;
  RUN flutter channel stable
  </code></pre>
  <p>Everything goes fine until the last step, where I get:</p>
  <pre><code>Step 5/5 : RUN flutter channel stable
   ---&gt; Running in f8e764b1e091
  Downloading Dart SDK from Flutter engine 82b4ae86d69b4bad10a42ad380f2a538d97ffb38...
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  174M  100  174M    0     0  23.1M      0  0:00:07  0:00:07 --:--:-- 23.8M
  Building flutter tool...
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (6 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (5 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (4 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (3 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (2 tries left)
  /flutter/bin/cache/dart-sdk/bin/pub: line 49: /flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
  Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (1 tries left)
  Command 'pub upgrade' still failed after 10 tries, giving up.
  The command '/bin/sh -c flutter channel stable' returned a non-zero code: 1
  </code></pre>
  <p>Why?</p>
  <h2>Note</h2>
  <p>I tried:</p>
  <ul>
  <li>running <code>flutter doctor</code> instead of <code>flutter channel stable</code> -- still the same problem</li>
  <li>using the <code>root</code> user -- still the same problem</li>
  <li>using Ubuntu instead of Alpine -- works as expected, but I'd like to use Alpine</li>
  </ul>