I would like to install Flutter on a Docker container running Alpine Linux.
I wrote the following Dockerfile
:
FROM alpine
RUN apk add bash curl file git zip
RUN git clone https://github.com/flutter/flutter.git
ENV PATH="$PATH:/flutter/bin"
RUN flutter channel stable
Everything goes fine until the last step, where I get:
Step 5/5 : RUN flutter channel stable
---> 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
Why?
Note
I tried:
- running
flutter doctor
instead offlutter channel stable
-- still the same problem - using the
root
user -- still the same problem - using Ubuntu instead of Alpine -- works as expected, but I'd like to use Alpine