Potential docker enhancements & two-stage build #940
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Good day,
The attached PR makes two slight changes only to the docker workflow. The first is changing from privileged to device with rwm. The latter is common in the sdr docker world and reduces the privilege of the container. It is still running as root, but now as least it has the basic limitations. This change works both on the existing image (the one you would pull from docker pull today) and the two-stage build included (since ideally that build works identically, just smaller).
The second change is a conversion from a single to dual stage build. This allows a ~2.5 GB reduction in size of the image. This is accomplished by building trunk-recorder (and first gr-osmosdr) and copying those over to the final image. The other change is that the final image only has the runtime packages and not the full dev packages. One of the larger changes here is only adding the gnuradio dependencies that trunk-recorder actually needs instead of gnuradio. gnuradio has a qt dependency if that gets added to the build you pull in the xorg stack and several kitchen sinks.
It is possible when the ubuntu image moves forward, the associated apt-get library lines will need updating as there isn't a metapackage. For example, Debian is on libgnuradio-network3.10.5 instead of .1, so that would need tweaking when the bump to the next ubuntu LTS happens.
This needs testing of course, but it's working fine for me so far and it should work the same as the previous image. Just much smaller.