Sign inSign up

ethernetz/docker-flutter

By ethernetz

•Updated over 3 years ago

a container for flutter development

Image
0

801

ethernetz/docker-flutter repository overview

⁠docker-flutter

docker-flutter the perfect ready-to-use flutter dev environment 🥳

inside the container you'll find

  • flutter (duh)
  • android SDK and a device all ready to go
  • noVNC to see play with the emulator in the broswer

all this is happening inside a devcontainer 🤯

image

⁠why would i use this?

you get a consistent dev environement in 1 command, no matter the host machine 😍

spend 0 seconds trying to set up java, android studio, or flutter 🔥

⁠getting started

⁠basic command

by default, docker-flutter will run the flutter doctor command to show you everything is working

docker run -it ethernetz/docker-flutter

image
⁠dev environment

to set up a dev container, you'll also need to

  • volume mount your project in the /developer directory
  • forward port 6080
  • add sleep infinity at the end to make sure the container stays open once its created

the final command should look like this

docker run -it -v "$PWD":/developer -p 6080:6080 ethernetz/docker-flutter sleep infinity

⁠dev container

flutter-docker even works inside a dev container

.devcontainer/devcontainer.json

{
  "image": "ethernetz/docker-flutter:latest",
  "customizations": {
    "vscode": {
      "extensions": ["Dart-Code.flutter", "Dart-Code.dart-code"]
    }
  },
  "forwardPorts": [6080],
  "runArgs": ["--privileged"]
}

⁠running the emulator

once your dev environment is set up, it just takes 4 commands to see your flutter app in an android emulator

⁠start the VNC to the emulator has a display to write to

Xtigervnc ${DISPLAY} -rfbport ${VNC_PORT} -localhost -SecurityTypes=none

⁠expose the display to the broswer with noVNC

/home/developer/noVNC/utils/novnc_proxy --vnc localhost:${VNC_PORT} --listen ${NOVNC_PORT}

⁠start the emulator

/home/developer/start_emulator.sh

image
⁠once the emulator is ready, start the flutter app!

flutter run -d emulator-5554

image

Tag summary

Content type

Image

Digest

sha256:e22353916…

Size

3.7 GB

Last updated

over 3 years ago

docker pull ethernetz/docker-flutter