Cant build on arm64
Hi, I'm trying to build this docker image on a mac with m1 chip and I'm receiving the next error
[13/13] RUN flutter config --enable-web && flutter doctor:
#16 3.234 Setting "enable-web" value to "true".
#16 3.237
#16 3.237 You may need to restart any open editors for them to read new settings.
#16 6.759 Doctor summary (to see all details, run flutter doctor -v):
#16 7.282 [✓] Flutter (Channel stable, 2.10.1, on Ubuntu 20.04.3 LTS 5.10.76-linuxkit, locale en_US)
#16 7.290 [✗] Android toolchain - develop for Android devices
#16 7.296 ✗ Unable to locate Android SDK.
#16 7.296 Install Android Studio from: https://developer.android.com/studio/index.html
#16 7.297 On first launch it will assist you in installing the Android SDK components.
#16 7.297 (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
#16 7.297 If the Android SDK has been installed to a custom location, please use
#16 7.298 `flutter config --android-sdk` to update to that location.
#16 7.298
#16 7.303 [✓] Chrome - develop for the web
#16 7.336 [!] Android Studio (not installed)
#16 7.964 [✓] Connected device (1 available)
#16 9.348
#16 9.348 ===== CRASH =====
#16 9.348 si_signo=Segmentation fault(11), si_code=1, si_addr=0x808080808080809f
#16 9.348 version=2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "linux_x64"
#16 9.348 pid=124, thread=132, isolate_group=main(0x4002f9b000), isolate=main(0x4002f9d000)
#16 9.348 isolate_instructions=4001e1b540, vm_instructions=4001e1b540
#16 9.348 pc 0x0000ffff864046a9 fp 0x000000400ff71338 Unknown symbol
#16 9.348 pc 0x0000ffff84902142 fp 0x000000400ff71390 Unknown symbol
#16 9.348 pc 0x0000ffff84f624eb fp 0x000000400ff71430 Unknown symbol
#16 9.349 pc 0x0000ffff858059c9 fp 0x000000400ff714a8 Unknown symbol
#16 9.349 pc 0x0000ffff8580585c fp 0x000000400ff71510 Unknown symbol
#16 9.349 pc 0x0000ffff85805516 fp 0x000000400ff715a8 Unknown symbol
#16 9.349 pc 0x0000ffff8580519e fp 0x000000400ff715f8 Unknown symbol
#16 9.349 pc 0x0000ffff85804ebe fp 0x000000400ff71658 Unknown symbol
#16 9.349 pc 0x0000ffff8580430f fp 0x000000400ff716d8 Unknown symbol
#16 9.349 pc 0x0000ffff858031ab fp 0x000000400ff71720 Unknown symbol
#16 9.349 pc 0x0000ffff84f71db9 fp 0x000000400ff71770 Unknown symbol
#16 9.349 pc 0x0000ffff858059c9 fp 0x000000400ff717e8 Unknown symbol
#16 9.349 pc 0x0000ffff8580585c fp 0x000000400ff71850 Unknown symbol
#16 9.349 pc 0x0000ffff85805516 fp 0x000000400ff718e8 Unknown symbol
#16 9.349 pc 0x0000ffff8580519e fp 0x000000400ff71938 Unknown symbol
#16 9.349 pc 0x0000ffff85804ebe fp 0x000000400ff71998 Unknown symbol
#16 9.349 pc 0x0000ffff8580430f fp 0x000000400ff71a18 Unknown symbol
#16 9.349 pc 0x0000ffff858031ab fp 0x000000400ff71a60 Unknown symbol
#16 9.349 pc 0x0000ffff861fe255 fp 0x000000400ff71aa0 Unknown symbol
#16 9.349 pc 0x0000ffff84f64424 fp 0x000000400ff71b40 Unknown symbol
#16 9.349 pc 0x0000ffff858059c9 fp 0x000000400ff71bb8 Unknown symbol
#16 9.349 pc 0x0000ffff8580585c fp 0x000000400ff71c20 Unknown symbol
#16 9.349 pc 0x0000ffff85805516 fp 0x000000400ff71cb8 Unknown symbol
#16 9.349 pc 0x0000ffff8580519e fp 0x000000400ff71d08 Unknown symbol
#16 9.349 pc 0x0000ffff85804ebe fp 0x000000400ff71d68 Unknown symbol
#16 9.349 pc 0x0000ffff8580430f fp 0x000000400ff71de8 Unknown symbol
#16 9.349 pc 0x0000ffff858031ab fp 0x000000400ff71e30 Unknown symbol
#16 9.349 pc 0x0000ffff84cfe016 fp 0x000000400ff71e70 Unknown symbol
#16 9.349 pc 0x0000ffff858059c9 fp 0x000000400ff71ee8 Unknown symbol
#16 9.349 pc 0x0000ffff8580585c fp 0x000000400ff71f50 Unknown symbol
#16 9.349 pc 0x0000ffff85805516 fp 0x000000400ff71fe8 Unknown symbol
#16 9.349 pc 0x0000ffff8580519e fp 0x000000400ff72038 Unknown symbol
#16 9.349 pc 0x0000ffff85804ebe fp 0x000000400ff72098 Unknown symbol
#16 9.349 pc 0x0000ffff8580430f fp 0x000000400ff72118 Unknown symbol
#16 9.349 pc 0x0000ffff858031ab fp 0x000000400ff72160 Unknown symbol
#16 9.349 pc 0x0000ffff84f71db9 fp 0x000000400ff721b0 Unknown symbol
#16 9.349 pc 0x0000ffff858059c9 fp 0x000000400ff72228 Unknown symbol
#16 9.349 pc 0x0000ffff8580585c fp 0x000000400ff72290 Unknown symbol
#16 9.349 pc 0x0000ffff85805516 fp 0x000000400ff72328 Unknown symbol
#16 9.349 pc 0x0000ffff8580519e fp 0x000000400ff72378 Unknown symbol
#16 9.349 pc 0x0000ffff85804ebe fp 0x000000400ff723d8 Unknown symbol
#16 9.349 pc 0x0000ffff8580430f fp 0x000000400ff72458 Unknown symbol
#16 9.349 pc 0x0000ffff858031ab fp 0x000000400ff724a0 Unknown symbol
#16 9.349 pc 0x0000ffff85802fcd fp 0x000000400ff724e0 Unknown symbol
#16 9.349 pc 0x0000ffff861cf641 fp 0x000000400ff72550 Unknown symbol
#16 9.349 pc 0x0000ffff861cf3a9 fp 0x000000400ff725b0 Unknown symbol
#16 9.349 pc 0x0000ffff861cecb3 fp 0x000000400ff72640 Unknown symbol
#16 9.349 pc 0x0000ffff85b8beff fp 0x000000400ff726b0 Unknown symbol
#16 9.349 pc 0x0000ffff85b8bdfd fp 0x000000400ff726f0 Unknown symbol
#16 9.349 pc 0x0000ffff85802c73 fp 0x000000400ff72738 Unknown symbol
#16 9.349 pc 0x0000ffff858028eb fp 0x000000400ff72778 Unknown symbol
#16 9.349 pc 0x0000ffff85802819 fp 0x000000400ff727a0 Unknown symbol
#16 9.349 pc 0x0000ffff8580273e fp 0x000000400ff727e0 Unknown symbol
#16 9.349 pc 0x0000ffff84c9574a fp 0x000000400ff72860 Unknown symbol
#16 9.349 pc 0x0000ffff84c946ca fp 0x000000400ff72898 Unknown symbol
#16 9.349 pc 0x0000ffff84c9455c fp 0x000000400ff728c8 Unknown symbol
#16 9.349 pc 0x0000ffff861a3338 fp 0x000000400ff72930 Unknown symbol
#16 9.349 pc 0x0000ffff861a2be3 fp 0x000000400ff72980 Unknown symbol
#16 9.349 pc 0x0000ffff864029bf fp 0x000000400ff729f8 Unknown symbol
#16 9.352 pc 0x0000004001f97fbd fp 0x000000400ff72aa0 dart::DartEntry::InvokeCode(dart::Code const&, unsigned long, dart::Array const&, dart::Array const&, dart::Thread*)+0x14d
#16 9.352 pc 0x0000004001f97dfc fp 0x000000400ff72b00 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)+0x14c
#16 9.352 pc 0x0000004001f9a20f fp 0x000000400ff72b50 dart::DartLibraryCalls::HandleMessage(long, dart::Instance const&)+0x16f
#16 9.353 pc 0x0000004001fc1085 fp 0x000000400ff72c30 dart::IsolateMessageHandler::HandleMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message> >)+0x375
#16 9.353 pc 0x0000004001fe914c fp 0x000000400ff72ca0 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x14c
#16 9.353 pc 0x0000004001fe984f fp 0x000000400ff72cf0 dart::MessageHandler::TaskCallback()+0x1df
#16 9.353 pc 0x0000004002103678 fp 0x000000400ff72d80 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x138
#16 9.354 pc 0x0000004002103b0c fp 0x000000400ff72db0 dart::ThreadPool::Worker::Main(unsigned long)+0x5c
#16 9.355 pc 0x000000400207c9e8 fp 0x000000400ff72e70 /home/flutter/flutter-sdk/bin/cache/dart-sdk/bin/dart+0x207c9e8
#16 9.355 -- End of DumpStackTrace
#16 9.355 qemu: uncaught target signal 6 (Aborted) - core dumped
#16 9.380 /home/flutter/flutter-sdk/bin/internal/shared.sh: line 223: 124 Aborted "$DART" --disable-dart-dev --packages="$FLUTTER_TOOLS_DIR/.packages" $FLUTTER_TOOL_ARGS "$SNAPSHOT_PATH" "$@"
------
executor failed running [/bin/sh -c flutter config --enable-web && flutter doctor]: exit code: 134
I'm running the build command as this:
sudo docker build --platform linux/arm64 -t test/my-flutter:latest -f Dockerfile.dev .
@Djcharles26 Running into the same issue on M1 with Docker. Did you find a workaround?
For now I'll just build an image from scratch.
@tp Nothing here, please let me know if you successfully create this image, I really need it.
@Djcharles26 any luck?
I encountered the same error message from Docker Hub image, but building the image with the latest docker desktop (4.15.0) on M1 Mac seems to be no problem.
(I used flutter version 2.10.3 for https://github.com/geopaparazzi/GSS/blob/master/docker/Dockerfile.)
% git clone [email protected]:fischerscode/DockerFlutter.git
% cd DockerFlutter
% docker build --build-arg flutterVersion=2.10.3 --no-cache -t fischerscode/flutter:2.10.3 .
% docker run --rm fischerscode/flutter:2.10.3 flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 2.10.3, on Ubuntu 20.04.5 LTS 5.15.49-linuxkit, locale en_US)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Flutter IDE Support (No supported IDEs installed)
[!] Connected device
! No devices available
[✓] HTTP Host Availability
FYI
+1
I'm facing the same issue with version 3 or stable
Not sure if this is a Docker related issue but lscpu on M2 mac says it's x86
➜ ~ docker run --platform=linux/arm64 fischerscode/flutter lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Vendor ID: 0x00
Model: 0
Thread(s) per core: 1
Core(s) per socket: 8
Socket(s): 1
Stepping: 0x0
BogoMIPS: 48.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Ubuntu image reports the correct arch
➜ ~ docker run --platform=linux/arm64 ubuntu lscpu
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
bfbe77e41a78: Pull complete
Digest: sha256:2b7412e6465c3c7fc5bb21d3e6f1917c167358449fecac8176c6e496e5c1f05f
Status: Downloaded newer image for ubuntu:latest
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Vendor ID: 0x00
Model: 0
Thread(s) per core: 1
Core(s) per cluster: 8
Socket(s): -
Cluster(s): 1
Stepping: 0x0
BogoMIPS: 48.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected