Add Docker Images and CI Workflow #815
Open
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.
This PR is meant to add:
The contribution guidelines are not very clear on what this type of PR would fall under, and the Roadmap seems to be a bit outdated and focused on the actual RNS codebase itself.
Since this is more of an Ops type of thing, hopefully this PR is not annoying.
Docker Images
There are two dockerfiles, one for end-users to quickly get started and one for CI use in github actions.
The created image has the following properties:
rnsdand all toolingrootto ensure a compromised user account cannot replace binaries with malicious versions (but it is also unnecessary to use venvs or user home directories to compartmentalize since we are running in a container, which by definition is compartmentalized)/config) for easy of mounting (see previous wrt. home directories)rnsdexecuted as PID1, no other processes running in the containerdocker execcryptographydo not have ready-made wheels for architectures outside ofamd64andarm64, so pip will need to compile from sourceThe current footprint sits at around ~70MB uncompressed vs ~43MB for the base alpine python image, which means the image is almost as size efficient as it could possibly be - the multi-stage build only adds <1MB vs if you just pip installed rns without any compilation dependencies:
(Built on macos, the actual github generated images are 5-15MB smaller)
Github Actions
I have added jobs to the existing github workflows that will build docker images (multi-platform in parallel using matrix strategy) for the architectures most likely to be used by end-users (more can be added in the future, if needed)
I have changed the
packagejob to always run (not just on tag events), so that users can access build artifacts as well as docker images for branches/PRs (might help users with testing). Example ExecutionWhen a tag/release is created, docker images are also created with the same tag, which also auto-updates the

latestimage tag, example from my fork:Users can choose to get images tagged by
latest, by major.minor version or by major.minor.patchCertain architectures take a LONG time to build due to compilation times and emulation, armv6 and v7 take roughly 15 minutes for example
Documentation
I have created a simple README relating to docker usage, as well as an example docker-compose file, which should help people quickly get started with containerized deployments
Improvements
I think in the future, looking into distroless final images would be nice if greatly reducing the image size is a priority (as well as reduced attack surface)
Perhaps having examples of a more advanced docker-compose deployment with multiple RNS-based services talking to each other using docker networks would be nice