-
Notifications
You must be signed in to change notification settings - Fork 5
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
Migrate from https://gitlab.com/daviddaish/freecad_docker_env/ #1
base: master
Are you sure you want to change the base?
Conversation
Whoops, closed it because I didn't think the newest commit would be included in the pull request. |
Any traction on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is real great stuff 👌
Merging the PR seems long overdue to me.
## Pull image | ||
|
||
``` | ||
docker pull registry.gitlab.com/daviddaish/freecad_docker_env:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the readme.md
in the target FreeCAD/Docker
-repo contain references to gitlab / daviddaish?
Did this post get any follow-up?
@@ -0,0 +1,89 @@ | |||
This is a docker container intended to act as a build and run environment for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a docker container intended to act as a build and run environment for | |
This is a linux docker container intended to act as a build and run environment for |
Building the docker image will take several hours. | ||
|
||
``` | ||
docker build -t registry.gitlab.com/daviddaish/freecad_docker_env:latest . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is convenient for end-users, but should the instructions for building be for a remote version or for the repo-local dockerfile, or maybe both?
|
||
cd /mnt/build | ||
|
||
make -j $(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason not to add --build -j $(nproc)
to the cmake-invocation and instead do a separate cd
/make
?
@@ -0,0 +1,165 @@ | |||
GNU LESSER GENERAL PUBLIC LICENSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does FreeCAD have any policy on licenses?
I saw that the license is the same as here so I'm also asking to make sure that the choice of license was intentional and that it didn't just slip along
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPL is avoided to make it possible to use with propritary tools and libraries. Most of freecad is LGPL.
MIT, BSD and similar is ok too.
|
||
WORKDIR /root | ||
|
||
# Note for later: May need -fPIC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What may need -fPIC
?
AFAIK it's never bad to use -fPIC
(unless maybe you are doing lowlevel embedded stuff)
mkdir /tmp/Python-3.7.6/build && cd /tmp/Python-3.7.6/build && \ | ||
../configure --enable-shared \ | ||
--enable-unicode=ucs4 --enable-ipv6 && \ | ||
make -j $(nproc --ignore=2) && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that a lot of the nproc
-invocations get --ignore=2
.
Is there any reason not to build faster, or would it make sense to turn this into a non-hardcoded configuration?
As you've commented elsewhere (end of readme) it can take up to several hours to build the image, so for dedicated build computers or when you go for a walk during the build it might be nice to build as fast as possible.
WORKDIR /tmp | ||
|
||
# Build tools, and misc supporting tools | ||
RUN apt update && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any cleaning of the apt cache in the Dockerfile, yet there isn't any packages cached when I run it.
I've had to manually remove cached packages and temporaries in other dockerfiles.
Do you know why it doesn't seem to be needed in this one?
@kkremitzki shall we? |
Is it really necessary to have such a complicated docker file? Why use stretch where it seems you have to build a lot of dependencies because their outdated, for reference I use this dockerfile to build freecad packages for archlinux. |
@adrianinsaval I think the original dockerfile was intended to create a setup with the exact tools/versions desired. I built a copy of your image as the original can't build master anylonger, but how am I supposed to use your image to build (&run?) freecad? It starts a distcc deamon, is that a common pattern for images? |
I made it because I wanted to experiment with distributing my compilation between 3 machines with distcc, I want to build from my manjaro laptop and it didn't work without docker because the gcc version in the other 2 (that run debian) didn't match. That's why it just starts a distcc client that my laptop connects to. In your case it will probably be better to set your start point to something like bash. I just posted mine as an example of how much simpler managing the dependencies in a more up to date distro could be, IMO archlinux wouldn't be a good idea to have an easy to reproduce environment, maybe ubuntu would be better? |
I put together a simple dockerfile and used it to build FC last evening, I'll follow my own advice and send it as a PR to the repo. Interestingly, I found this ancient dockerfile hidden in subfolders of the main FC repo. |
Note, this doesn't include commit history of the gitlab.com/daviddaish/freecad_docker_env/ repo.