matsp / docker-flutter

flutter docker image with full android sdk
https://hub.docker.com/repository/docker/matspfeiffer/flutter
MIT License
262 stars 90 forks source link

Anonymous volumes #6

Open pkill37 opened 3 years ago

pkill37 commented 3 years ago

I am not a Flutter expert, but Flutter writes stuff to special files and directories when installing packages and whatnot.

If one is using Docker images such as this one simultaneously with other environments (other Docker images, or a local installation) then you are not guaranteed a clean slate because you suggest -v "$PWD":/project which mirrors all files between the local environment and the container (including these special files and directories).

Shouldn't you have anonymous volumes for these special files and directories so they are not mirrored by -v "$PWD":/project?

matsp commented 3 years ago

If you want to use the docker image as command (with the right alias mapping) it's exactly what you want. Using the flutter cli from the image instead of installing it.

But as always you can do whatever you want with this image. If you just want to build an app for production this is also possible.