Add support for building in a container #3722
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.
One of the difficulties I've found in hacking on sandstorm is that that dependencies differ between distributions and between distribution versions. It's not always clear how to get the dependencies for your OS and there's not reliable automated way to do it. For example, right now, our CI only works on Ubuntu 20.04 and it's not clear why.
To address this, this PR adds a simple Python tool (
container-build.py
) for building Sandstorm in a Docker/OCI container based on Ubuntu 20.04. Currently, the tool only works with Podman. It has three different actions:prepare
: Builds a new container namedsandstorm-build
on your local machine based on theDockerfile
. The container build process does the following:METEOR_WAREHOUSE_DIR
shell
: Callsprepare
and then shells into thesandstorm-build
container.make
: Callsprepare
and then runsmake
in the container.So as long as you have Podman installed, you can run
./container-build.py make
at the root of this repo and you will have a built version of Sandstorm. You don't need to have most of the other dependencies installed, you just need podman.If the actions are followed by additional arguments, those are are added to the end:
./container-build.py make
.Of note: the user permissions in your development directory stay the same when running this tool. It's like if you called
make
normally.Some limitations: