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!
iyd2019
Posts: 108
Joined: Tue Oct 15, 2019 9:19 am

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

Post by iyd2019 »

Menfin wrote: Mon Jun 08, 2020 7:04 am

Code: Select all

fc_source=~/media/xxx/86ff3cff-2537-4ef6-8bd4-d73e652442b0/BackUpGIT/Freecad/freecad-source/
fc_build=~/media/xxx/86ff3cff-2537-4ef6-8bd4-d73e652442b0/BackUpGIT/Freecad/freecad-build/
other_files=~/
those paths are correct?

Code: Select all

fc_source="put_here_path_to_FC_source"
fc_build="put_here_path_to_a_newly_created_build_folder"
other_files="optional"

Code: Select all

docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
this seems fine

It doesn't works ... In fact, there's nothing in mnt/source directory. The error message is :

Code: Select all

CMake Error: The source directory "/mnt/source" does not appear to contain CMakeLists.txt.
There's a mistake somewhere but I don't know where, could you help me ?
I suspect that your paths are invalid...

mines are like this:

Code: Select all

fc_source=/home/iyd2019/FreeCAD-project/source
fc_build=/home/iyd2019/FreeCAD-project/build
other_files=/home/iyd2019/git/FreeCAD-project/
once your docker is running, what happens if you try these commands?

Code: Select all

root@b9aaa4749fe8:~# ls -la /mnt/source
root@b9aaa4749fe8:~# ls -la /mnt/build
BR!
Menfin
Posts: 4
Joined: Mon Jun 08, 2020 6:43 am

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

Post by Menfin »

I have changed the location of source and build directory and it seems to be OK ...
There are just some warnings, but the compilation is OK ... ;) :

Code: Select all

<command-line>:0:8: warning: ISO C++11 requires whitespace after the macro name
... [-Wdeprecated-declarations]
...
Thanks for your help ...

I have another question :
Is there a direct command line to launch Freecad from one terminal, without entering first in docker ... ?
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 »

iyd2019 wrote: Thu Jun 04, 2020 6:34 pm Hi there!

I have just finished configuring MacOS to get David's FreeCAD Docker image successfully running in my macbookpro, including GUI!!. It was not straight forward, so here are the steps that maybe could be included in the Compile_on_Docker#Mac_OS_users:
Hey, I'm rather annoyed with myself that I didn't acknowledge this earlier, but I've just rolled off a set of final exams, which rather occupied my time.

Hot damn! Thank you very much for doing this, and helping Menfin. I'm going to spend the break taking your work and putting it in the main project and documentation.
iyd2019
Posts: 108
Joined: Tue Oct 15, 2019 9:19 am

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

Post by iyd2019 »

David_D wrote: Sun Jun 21, 2020 11:10 pm Hot damn! Thank you very much for doing this, and helping Menfin. I'm going to spend the break taking your work and putting it in the main project and documentation.
My changes for MacOS doesn't work -> https://forum.freecadweb.org/viewtopic. ... 30#p405755

The Gui starts, but as soon as you request any OpenGL stuff, it hangs :(

I'm pretty busy myself, so don't get too hard on yourself: this is voluntary work!!

BR!
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 »

Menfin wrote: Mon Jun 08, 2020 1:07 pm Is there a direct command line to launch Freecad from one terminal, without entering first in docker ... ?
Yeah, you could combine the commands into a single command like this, and include /mnt/build/bin/FreeCAD at the end of the run command:

Code: Select all

xhost +local: && fc_source=~/code/freecad_source && fc_build=~/code/freecad_build && other_files=~/ && docker run -it --rm -v $fc_source:/mnt/source -v $fc_build:/mnt/build -v $other_files:/mnt/files -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro registry.gitlab.com/daviddaish/freecad_docker_env:latest /mnt/build/bin/FreeCAD
... But don't think you'd be making things any easier for yourself. Your choice.
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 »

iyd2019 wrote: Sun Jun 21, 2020 11:34 pm My changes for MacOS doesn't work -> https://forum.freecadweb.org/viewtopic. ... 30#p405755

The Gui starts, but as soon as you request any OpenGL stuff, it hangs :(

I'm pretty busy myself, so don't get too hard on yourself: this is voluntary work!!

BR!
Ah well, the NVIDIA fix you came up with is pretty fantastic by itself. I've thoroughly buggered my computer on more than one occasion doing all the switching between graphics drivers. I still need to turn that into a new image.

I'd help you with the mac issue, but I don't have any macs nearby. Perhaps I can convince my roommate to let me play with his. :twisted: :twisted:
brickmaker
Posts: 6
Joined: Thu Aug 13, 2020 7:17 pm

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

Post by brickmaker »

I am trying to get it to run on a mac as well and after I do type this code

Code: Select all

docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
I open docker and see sweet_faraday docker running but in the terminal it has me in root@c3bd090c3000 and only contains the file build_script.sh. When I type sh build_script.sh it says "CMake Error: The source directory "/mnt/source" does not exist.
Specify --help for usage, or press the help button on the CMake GUI." ? if I try to type --help like it says that doesnt help and I dont have the CMake GUI installed. Any thoughts on what is going on?
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 »

brickmaker wrote: Wed Aug 19, 2020 5:05 am I am trying to get it to run on a mac as well and after I do type this code

Code: Select all

docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
I open docker and see sweet_faraday docker running but in the terminal it has me in root@c3bd090c3000 and only contains the file build_script.sh. When I type sh build_script.sh it says "CMake Error: The source directory "/mnt/source" does not exist.
Specify --help for usage, or press the help button on the CMake GUI." ? if I try to type --help like it says that doesnt help and I dont have the CMake GUI installed. Any thoughts on what is going on?
Did you define the environment variables fc_source and fc_build? It sounds like you didn't mount anything.
brickmaker
Posts: 6
Joined: Thu Aug 13, 2020 7:17 pm

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

Post by brickmaker »

David_D wrote: Wed Aug 19, 2020 7:06 am
brickmaker wrote: Wed Aug 19, 2020 5:05 am I am trying to get it to run on a mac as well and after I do type this code

Code: Select all

docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
I open docker and see sweet_faraday docker running but in the terminal it has me in root@c3bd090c3000 and only contains the file build_script.sh. When I type sh build_script.sh it says "CMake Error: The source directory "/mnt/source" does not exist.
Specify --help for usage, or press the help button on the CMake GUI." ? if I try to type --help like it says that doesnt help and I dont have the CMake GUI installed. Any thoughts on what is going on?
Did you define the environment variables fc_source and fc_build? It sounds like you didn't mount anything.
Ok I tried it by doing this with the environment variables and they were created but I still get the same CMake issue?

Code: Select all

docker run -it -e fc_source=~/my_code/freecad_source -e fc_build=~/my_code/freecad_build -e other_files=~/  --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \   
-v $other_files:/mnt/files \                                              
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
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 »

brickmaker wrote: Wed Aug 19, 2020 5:06 pm Ok I tried it by doing this with the environment variables and they were created but I still get the same CMake issue?

Code: Select all

docker run -it -e fc_source=~/my_code/freecad_source -e fc_build=~/my_code/freecad_build -e other_files=~/  --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \   
-v $other_files:/mnt/files \                                              
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest
You're not assigning any environment variables with that command. Using the -e flag sets the environment variables within the docker container. The environment variables need to be set outside the docker container so the docker run command can use them. You can tell, because the run command references them with $fc_source $fc_build etc. Please follow the instructions on the wiki page or the gitlab readme.
Post Reply