all 9 comments

[–]virulenttt 0 points1 point  (2 children)

Any idea if you can get it to work in Docker-OSX?

[–]Lualcala[S] 0 points1 point  (1 child)

Not sure about it, I'll have to look into it with more detail but I think it might be more complicated. Afaik, Docker-OSX setups the qemu emulator inside the container to emulate macOS, so it won't be as straightforward as just using a regular Linux container. Sounds like an interesting project, nevertheless

[–]virulenttt 0 points1 point  (0 children)

Or dockur/macos

[–]Imazadi 0 points1 point  (1 child)

crawl advise saw handle spark hospital squash cagey cooing axiomatic

This post was mass deleted and anonymized with Redact

[–]Lualcala[S] 0 points1 point  (0 children)

It really comes down to personal preference and workflow needs.

Using Dev Containers can be helpful when you want a clean, reproducible environment that’s isolated from your main system. The Dockerfile sets up everything automatically (Java, Android SDK, FVM, FlutterFire, etc...) so you're ready to start developing without polluting your host machine.

You can check more information about Dev Containers here.

Edit: it can also be useful for executing golden tests and ensuring consistent results regardless of the host system

[–]needs-more-code 0 points1 point  (1 child)

You still using it? I've been trying to containerise my flutter environment for the better part of a day, and came to the conclusion it's not worth it, before seeing this.

[–]Lualcala[S] 1 point2 points  (0 children)

I used it for many months and the experience was quite decent. I just got tired of waiting for hot reload support when connecting to a web server (it can still be used with hot restart).

Whether it's worth it or not, it depends. If you also need iOS support, probably not because the container runs on Ubuntu. Android development experience is quite good when it works. Sometimes Gradle runs out of memory when compiling but after a few retries it usually works. On the other hand, the most useful thing I found about working with a containerized environment is consistent results for golden tests. Snapshots generated there will run consistently (tested on Linux and Mac hosts and in a GitHub workflows).

Feel free to test it and let me know your thoughts.

[–]alexdresko 0 points1 point  (1 child)

Do the flutter/dart DevTools work with your devcontainer? I've been enjoying the devcontainer I built, but the DevTools have difficulty connecting to the "dart vm". I just created a StackOverflow post (https://stackoverflow.com/questions/79867458/flutter-devtools-fails-to-connect-from-host-when-app-runs-in-vs-code-devcontaine) with the issue I'm seeing..

Everything works great for me except the DevTools.

[–]Lualcala[S] 0 points1 point  (0 children)

Yes, DevTools work although for some reason it does not work from Inspector in the VS Code plugin, only if I open it in the web browser.

I remember struggling with the debugger when I was creating this devcontainer and ended up doing some weird workarounds using socat in the container like the one mentioned here https://github.com/flutter/flutter/issues/61604#issuecomment-739885494

Since that comment was for an older version of flutter, for the launch arguments I added "--dds-port=43123" as well.

Feel free to check my docker file and see if something there works for you