-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add Docker support and update README #13
Conversation
It's great, but I have wanted to have inv_sig_helper inside scratch image so that there is nothing that google may exploit from if they really want to. Something like this:
|
I'd tried to use a scratch image for the second stage but had issues with OpenSSL dependencies initially.
I'd appreciate your thoughts. |
It's great but the final goal is to have a multi architecture docker image. Because invidious does not support only x86. |
Dockerfile now detects the architecture being used during the build process and templates in the correct Rust target architecture
Great, awesome! We might even be able to add build to quay.io? You can take example on https://github.com/iv-org/invidious/blob/master/.github/workflows/build-stable-container.yml and I'll add the correct tokens for quay.io login |
Would you mind checking if you could lock down the container by removing some capabilities like searxng is doing: https://github.com/searxng/searxng-docker/blob/master/docker-compose.yaml? I think we will only need And could you set Credentials were added for quay.io: https://quay.io/repository/invidious/inv-sig-helper |
@unixfox Added a workflow to build and push a container image to quay.io in 95b602e Triggers on pushes to master and version tags, with semver used for tagging (e.g., Let me know if any changes are needed |
|
More flexible as the build process will now automatically adapt to whatever architecture the container is being built on, without needing to explicitly list out each supported architecture
Could you try to run under a non-privileged user in scratch: https://medium.com/@lizrice/non-privileged-containers-based-on-the-scratch-image-a80105d6d341? |
Is there a way to include a E.g. some endpoint
|
inv_sig_helper doesn't use the HTTP protocol, so just check if the port is still open? (or use one of the opcodes that do nothing but return info like |
No. It's going to be the development docker compose not the production one. A production docker compose will be published under https://docs.invidious.io |
- Run as a non-privileged user within the scratch container - Add security_opt: - no-new-privileges:true to docker-compose.yml
Since we're using a scratch image, I don't think healthchecks are possible unless we copy a utility like netcat from an earlier stage |
- rust:1.80-alpine replaced with rust:1.80 for the builder stage - alpine:3.20 replaced with debian:12.6-slim for the user-stage - Build command simplified to use default target architecture
…command" This reverts commit ff9a378. Reasons for reverting: 1. Compiling via musl is necessary to statically link dependencies and create a truly standalone Rust binary. [1] 2. Alpine-based Rust images are required for the build stage because such systems support dynamic linking, which is also needed for statically-linked binaries. [2] 3. Determining the target architecture and templating the correct value for the --target flag is necessary for the statically-linked binary to be built correctly. [2] [1]: https://doc.rust-lang.org/1.13.0/book/advanced-linking.html#linux [2]: rust-lang/rust#40174 (comment)
Not sure how to meaningfully improve the Dockerfile as of 6b94718 The target arch detection isn't overly complex and doesn't hard-code architectures in the build process, and image tests via |
Thank you for all the effort @perennialtech! It's already a very good start. We will see another time if we need to improve the Docker image, for now it works great. |
Thanks for your contribution @perennialtech |
This PR introduces containerisation support for
inv_sig_helper
and improves documentation:Fixes #3.