Skip to content

Build recipes in Dockerfile + fixes for rootless - #168

Draft
rickyelopez wants to merge 1 commit into
ferdium:mainfrom
rickyelopez:rl/nonroot
Draft

Build recipes in Dockerfile + fixes for rootless#168
rickyelopez wants to merge 1 commit into
ferdium:mainfrom
rickyelopez:rl/nonroot

Conversation

@rickyelopez

Copy link
Copy Markdown

Just opening this to hopefully get a sense of whether rootless operation is something that you would be interested in supporting.

I was not able to come up with a way to build the recipes at startup when running as a non-root user. I realize that one of the big reasons to host this locally is to be able to use custom recipes. I'm sure there's a clever way to support it (like maybe docker execing a command as root to build the recipes) but even if there isn't, all the building code I removed from entrypoint.sh could be re-introduced behind a if [ "$RECIPE_SOURCE" != "bundled" ] check, or similar, to support both usecases with an env var.

The only other changes that were really required to run rootless were:

  • Change the key generation command from adonis key:generate --force to node ace generate:key which I think is equivalent? Not positive.
  • Prepend the node commands (both the existing migrate command and the ace generate:key command added above) with CACHE_DIR=/tmp/adonis-cache to get it to put the cache somewhere the non-root use has access to.

Building the recipes in the Dockerfile could also be avoided if builds were added to the recipes repo directly. Then, this Dockerfile could just pull down the latest set of artifacts from there. I had to add git to the recipes builder because simple-git was erroring out without it. Definitely avoidable with some changes to catch and handle the error, though.

Also, not sure if additional files need to be copied over from the recipes build. I copied what seem (to me) to be the relevant ones but I really only took a cursory glance here.

Is there any appetite to support this? No worries if not, this is working for me and probably won't be too bad to keep up-to-date for myself.

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.

1 participant