Skip to content
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

Allow building using docker. #145

Closed
wants to merge 1 commit into from

Conversation

PaarthShah
Copy link

At the time of writing, I blindly took the installation requirements from the README, and some dockerfile directives from element-desktop/dockerbuild/Dockerfile in order to construct this current Dockerfile. So far, I think it looks cleaner, though it definitely does not yet implement caching, and I only wrote a single new target make docker-pacman as a proof-of-concept.

But I'm definitely interested in doing this properly/implementing this further if there's any interest, and if this could help others build/develop on schildichat, and helping CI get going for the main devs.

@su-ex
Copy link
Member

su-ex commented Oct 29, 2022

Would this be feasible for podman somehow too? Or make it work for both through some sort of env var?
I'm definitely interested in this for easing the build process!

@su-ex su-ex closed this in fc27cbf Dec 4, 2022
@su-ex
Copy link
Member

su-ex commented Dec 4, 2022

I've now taken a look at this.
Since I'm using podman instead of docker I've reimplemented this in a more flexible way (both should work now probably) and also added a Containerfile for building rpm on latest Fedora which I plan to distribute from now on as well.

Thanks for this, I've got a lot of inspiration from it. 👍

If you've got an idea how to improve this and make it more efficient, please let me know! 🙂
For example, I had to copy the project folder into the image instead of using it as a volume due to stuff breaking (node dependencies and that encryption stuff) if shared between host and different containers. However, building the images takes far longer this way. 🕰️

@PaarthShah
Copy link
Author

PaarthShah commented Dec 4, 2022

@su-ex Aaa sorry for not seeing your older comment!

But I'm really glad that this was a good source of inspiration! Everything you're saying makes sense.

Slower build times honestly seem like a bit of a non-issue given that most people aren't going to build it themselves. I assume you'd still be able to build it on bare metal most of the time, and podman is just a convenience for being able to build for multiple environments, or for people to build it themselves with no fuss.

@su-ex
Copy link
Member

su-ex commented Dec 5, 2022

@PaarthShah Indeed, podman is of great use for me to build all the different variants for different platforms.
I've also discovered that the longer times of creation for the images can be quite worth it (especially if the same image is used multiple times later), because it allows high parallelization through separation, e.g. make -j 24 container-web-release container-debian-release container-rpm-release container-appimage-release.
Element's build process is apart from the rust stuff in between not quite multithreaded, but this way I can utilize my my multi-core CPU far better. 🥳

So thanks again, you've helped me advance my build process a lot and hopefully also helped others to build schildi with more ease (oh right, building containerized should be mentioned in the readme 💡😆)!

@cloudrac3r
Copy link

@PaarthShah This is awesome, thanks so much. It's really helped me to test out my local builds. The non-container process was giving me so much grief. I normally hate Docker, but this works so well and I have no complaints. Great work to you and su-ex! ❤

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.

3 participants