Add Dockerfile for networkless container support; Add ghcr docker auto deploy workflow #617
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.
Hey 👋
TL;DR
I've added a
prerestore.Dockerfile
which allows running the script wrapper in a networkless Docker container by restoring the required dependencies for the script environment inside the image creation.Also, I've added a Workflow script to build and deploy the docker image to ghcr.io.
Details
I discovered the project when I was looking for a script engine/wrapper Docker image for .NET, so I can use it for my current little project ranna-go/ranna. ranna is using networkless Docker containers for code execution to dodge various kind of problems you can run into with arbitrary code execution in network attached containers. But when doing so with the provided image, I ran into the following problem:
So, I've created a kind of hacky way to solve this by running an "empty" script during the image build process to embed the restored dependencies in the image. This workaround seems to work consistently.
Also, because I need to be able to fetch the image from a package registry, I've created an Actions Workflow to build and push the image to the GitHub Container Registry, which is kind of handy because you need no DockerHub credentials in your workflow and the image is directly highlighted on the repository page.
So I want to share these findings and changes I've made with you. Maybe it comes in handy for you, so you can merge them if you want to. 😄