Ticket #3821 - Docker env build container, now with FEM!

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
David_D
Posts: 81
Joined: Fri Jun 29, 2018 6:43 am
Location: Christchurch, New Zealand

Ticket #3821 - Docker env build container, now with FEM!

Post by David_D »

Hello, around a year ago, I created a docker container to make building FreeCAD for development purposes faster and easier. For those that are interested, it can now also build the FEM module. It includes all the latest versions of FreeCAD's dependencies, built from source, like Python 3.7, QT5.13, OCC 7.4, etc.

You can find it here: https://gitlab.com/daviddaish/freecad_docker_env

Somewhat related: I was wondering if it would be ok to document the existence of the docker container somewhere on the wiki's unix build instructions. I wouldn't want to make such a big change without the blessing of the veterans.
User avatar
David_D
Posts: 81
Joined: Fri Jun 29, 2018 6:43 am
Location: Christchurch, New Zealand

Re: Docker env build container, now with FEM!

Post by David_D »

Whoopsie. Found a build failing error that only occurs every now and again. Will fix this asap.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Docker env build container, now with FEM!

Post by Kunda1 »

Oh yea, I remember there is a ticket open for this on the tracker...lemme see if I can find it.

Edit: found it:
issue #3821
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
David_D
Posts: 81
Joined: Fri Jun 29, 2018 6:43 am
Location: Christchurch, New Zealand

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by David_D »

Ok, I have resolved the build issues. My apologies for the delay. The docker image takes the better part of a day to build from scratch, so it takes a long time to iterate and diagnose problems.

I believe it now works satisfactorily.

Assuming it's up to community standards, would it be alright to add this to the wiki, and close that ticket?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by Kunda1 »

Awesome. Thanks for all your work. We need some folks to test this and vet before we add to the wiki. Can you write a little more about how this could be useful for a developer's workflow?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
David_D
Posts: 81
Joined: Fri Jun 29, 2018 6:43 am
Location: Christchurch, New Zealand

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by David_D »

Kunda1 wrote: Sun Feb 09, 2020 3:03 am Awesome. Thanks for all your work. We need some folks to test this and vet before we add to the wiki. Can you write a little more about how this could be useful for a developer's workflow?
Absolutely. The main value that the docker image offers is dependency and build environment management.
  • All of FreeCAD's dependencies are already installed, compatible with each other, and configured appropriately, allowing you to get started developing very quickly.
  • They are contained within the docker container, preventing any unwanted packages contaminating your workstation, and preventing any clashing versions.
  • The source code and build directories are outside the docker container. This allows you to use your preferred editors, versioning systems, dev tools etc, without having to set them up in the docker container. You can just use them as normal, right from your workstation. (Also, it means you don't have to rebuild the docker container each time you want to build FreeCAD.)
  • For those using obscure *nix distros and instructions are not available for fetching dependencies, all you need to install on your workstation is docker, which is quite commonly available across many distributions.
  • It provides a static, immutable development environment. I personally find this useful when developing to reduce the number of potential variables that could be causing an issue. You know you've not altered something esoteric in the environment between builds. For developers collaborating, and both using the same docker container, you can be sure you're both working from the same environment, which reduces communication errors caused by differences in environment.
Does that describe it's purpose appropriately?
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by kkremitzki »

I've been wanting for us to maintain official Docker images. I can help with this. Please make PRs against https://github.com/freecad/docker and we can get started.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
David_D
Posts: 81
Joined: Fri Jun 29, 2018 6:43 am
Location: Christchurch, New Zealand

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by David_D »

kkremitzki wrote: Mon Feb 10, 2020 5:42 am I've been wanting for us to maintain official Docker images. I can help with this. Please make PRs against https://github.com/freecad/docker and we can get started.
Sounds reasonable, as much as it pains me to use a Microsoft product.

It appears I cannot create a pull request on account of the repo being empty. Could you please initialise it with a readme, or some such?
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by kkremitzki »

Sure, just did so.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
David_D
Posts: 81
Joined: Fri Jun 29, 2018 6:43 am
Location: Christchurch, New Zealand

Re: Ticket #3821 - Docker env build container, now with FEM!

Post by David_D »

kkremitzki wrote: Mon Feb 10, 2020 6:34 am Sure, just did so.
Great, I've made the pull request. If you'd like to get the commit history of the original repo, you'd probably want to delete this github repo, and clone the gitlab repo. I don't particularly care either way.

In other news, the docker images were hosted on gitlab, so if it's moving from there, there needs to be an appropriate way to host the images. Docker hub would work fine, but I'm not certain how FreeCAD manages permissions and what not.

That's putting the cart before the horse, however, because the current image should be vetted before anything along those lines happens. Does it work acceptably for you?
Post Reply