raspberrypi / pico-project-generator

Tool to automatically generate a Pico C SDK Project
BSD 3-Clause "New" or "Revised" License
289 stars 74 forks source link

Using Docker for generation, build, and development #72

Open cmrigney opened 1 year ago

cmrigney commented 1 year ago

I started to play around with adding a --docker flag to the project generator and am looking for feedback on whether it's worth opening a PR. The big benefit of Docker in this case is that users don't have to install or setup dependencies (compilers, cmake, make, or even the Pico SDK) on their machine. Which is one of the biggest pains I've experienced with Pico dev. And it will work exactly the same on Mac, Windows, and Linux across all users. They just need to install Docker.

The --docker flag would do 3 things.

1) Run the project generator inside a Docker container. This means the only dependency a user would have to have on their machine is python to run pico project generator script. The container provides the environment. Project files are still output like normal, via bind mounting to a host path in the container. 2) The generated project can be built in a Docker container. Again, the container provides the build environment. A user can run python build.py which builds the uf2 and other binaries in the Docker container that get output to the host machine. 3) The generated project can be developed in a Docker container. The container provides the development environment with full intellisense, including the Pico SDK. See this for more how dev containers work. Someone has already accomplished this. The project generator would just automate that setup with Docker.

I have a prototype of this implemented, just wondering if others are interested and if I should open a PR? Thanks.

ojg78 commented 1 year ago

Sounds like a fine idea