Dockerfile to cross compile for linux+mac+windows #201
Replies: 2 comments
-
@santrancisco Big thanks!!!! I always want to create dockerfiles to cross-compile, but I'm not familiar with docker. Do you think we could create some ready to use standard dockerfiles, and update the README, so everyone to could easily pull them anytime? |
Beta Was this translation helpful? Give feedback.
-
Hi @AllenDang @santrancisco NOTE I'm using podman since it is compatible with fedora, but docker should work here is my project using docker |
Beta Was this translation helpful? Give feedback.
-
I hope this may help someone and save them sometime when starting to play with giu. Today i wanted to play with giu, compiling it in my host (Linux) took sometimes but i got there in the end, then i wanted to try cross-compile for windows... then MacOSX... long story short, i ended up with a bunch of dependencies installation, trials and errors, testing with various compiling flags, env var and after successfully compiling them all in my host machine, I went through my bash history and started documenting everything into a Dockerfile what i needed and what worked for me.
What came out at the end is a Docker container that let me cross compile between Mac, Linux and Windows with the examples found here. Here is the gist where you can find my notes with Dockerfile to build a docker container with all the toolchains, a Makefile with all the flags/switches i used to compile for Mac, Nix and Windows app. I learnt a few tricks along the way like "-Hwindowsgui" makes the command prompt in windows goes away and adding ".app" extension do the same for MacOSX app.
Anyhow, Thanks @AllenDang for all the hard work! I'm looking forward to trial this in some small projects at work.
Beta Was this translation helpful? Give feedback.
All reactions