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

Potential docker enhancements & two-stage build #940

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Potential docker enhancements & two-stage build #940

merged 4 commits into from
Apr 9, 2024

Conversation

jquagga
Copy link
Contributor

@jquagga jquagga commented Mar 29, 2024

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.

❯ docker images
REPOSITORY                  TAG       IMAGE ID       CREATED          SIZE
jquagga/trunk-recorder      4.7.1     ff7f233d4460   13 minutes ago   603MB
robotastic/trunk-recorder   latest    a87c76a618d6   3 months ago     2.96GB

@robotastic
Copy link
Owner

This is really cool! I didn't realize that those GR library packages existed. @EricTendian would this break any of the things you are using the Docker image for?

@EricTendian
Copy link
Contributor

Agreed, this is awesome. @robotastic at this point I'm using the upstream Dockerfile, so this should be totally fine.

@cschmittiey
Copy link
Contributor

Awesome! Would love to see this merged.

@robotastic
Copy link
Owner

Let's give it a try! Report back if anyone has any issues.

@robotastic robotastic merged commit 12a019c into robotastic:master Apr 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants