Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added dockerfile for linux and android #407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rohansen856
Copy link
Contributor

@rohansen856 rohansen856 commented Dec 18, 2024

Description

Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.

Fixes #391

Replace issue_no with the issue number which is fixed in this PR

Screenshots

Summary

Three files in total was added in this PR

  • docker compose file
  • Dockerfile.linux
  • Dockerfile.android
    Using these files we can run flutter in containerized environment in both android and linux. For android device, We can either run it in an emulator or through a connected android device. There may be some native device problems due to the adb setup. It can be fixed using:
adb kill-server

Check again for all connected emulators:

adb devices
  • command to run in linux mode:
sudo docker-compose --profile linux up 
  • command to run in android mode:
sudo docker-compose --profile android up 
  • Added different files for android and linux as the android sdk is quite heavy and unneccesary for non-android emulators.

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@rohansen856
Copy link
Contributor Author

@BrawlerXull @Pavel401 I have added the containers and observed them to be running locally. I think there should be an update in the contributing file to add the functionality to run the app in containerized mode. Please let me know if anymore changes would be required. thank you.

Copy link
Member

@Pavel401 Pavel401 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please share some outputs? Specifically, a screen recording demonstrating how this will benefit the contributors. I haven’t come across any open-source Flutter repositories that support Docker.

@rohansen856
Copy link
Contributor Author

Could you please share some outputs? Specifically, a screen recording demonstrating how this will benefit the contributors. I haven’t come across any open-source Flutter repositories that support Docker.

Of course @Pavel401 I will do a screenrecording and show how the docker is working to setup the entire project with just 1 command.
The main benifit is that the flutter, dart and android sdk versionsof many devices vary and due to that the app might not work in many local devices (already happened with me!), the only solution would be updating local version of them, but as open source contributors might need to maintain several applications with their own desired version, it would become very problematic to constantly keep changing local dependency versions. AlthoughFVM` solves the problem to an extent but i's still prone to many errors.
The best solution is to containerize the application using docker so that maintaining local version is not an issue any more!

About other flutter repos, they may not be that focused on open source contributors so they might not expect the developers to face the constant versioning problem i think... Nevertheless containerizing the app would definitely make it easier to get the app up and running in an instant without any versioning hassle. Thank you.

@rohansen856
Copy link
Contributor Author

A Screen Recording of the running container

Screencast.from.2024-12-19.18-33-26.webm

@Pavel401
Copy link
Member

@BrawlerXull Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

feat: Containerization
2 participants