ros-tooling / cross_compile

A tool to build ROS and ROS2 workspaces for various targets
Apache License 2.0
188 stars 59 forks source link

Allow caching of Docker Image for reproducible builds. #285

Open casmer opened 3 years ago

casmer commented 3 years ago

Description

There is no way to specify and save the docker image created for a build to avoid having to redownload and setup the build environment. This also means that if updates occur to the base image and packages in the target image they will get applied not allowing one to build exactly what they build on a particular date.

Completion Criteria

Provide command line switches to do the following:

Testing Notes / Suggestions

create a build environment and output a build, use the cached environment to build an identical build.

emersonknapp commented 3 years ago

Good call - you can reuse the exact same image when you carefully don't touch anything, but the moment something gets shifted or a base image updates, you're right, it can take a really long time to rebuild, and not necessarily reproduce the results.

There are a few ways we could approach improving the experience, but I think that definitely custom tags for images to reuse instead of running specific steps would be a great way to go.

kjeremy commented 3 years ago

This would shave off about 15 minutes from my build... especially in the docker-in-docker case where caching becomes more complicated.

kjeremy commented 3 years ago

If someone can post a general outline of how to accomplish this I can try to tackle it next week.

emersonknapp commented 3 years ago

A reasonable-sounding first-pass: