osrf / rocker

A tool to run docker containers with overlays and convenient options for things like GUIs etc.
Apache License 2.0
533 stars 68 forks source link

Allow binary files to be copied into the build context #250

Closed agyoungs closed 8 months ago

agyoungs commented 8 months ago

The current write routine will not work if the data is a bytes type. This can happen if the get_files function reads in a file using the b mode (appropriate if it's a binary file).

This change simply checks if the data is a bytes class and sets the write mode accordingly

agyoungs commented 8 months ago

Thanks, this looks good. It would be great to have a quick unit test before merging to make sure there's not a regression in the future. I'll go over this once more when I'm back in the office next week.

I've now added another file for the file writing test that should cover this.