Closed PaarthShah closed 1 year ago
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!
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. :+1:
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. :mantelpiece_clock:
@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.
@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 💡😆)!
@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! ❤
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 currentDockerfile
. So far, I think it looks cleaner, though it definitely does not yet implement caching, and I only wrote a single new targetmake 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.