Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DavidDaish
Copy link

Note, this doesn't include commit history of the gitlab.com/daviddaish/freecad_docker_env/ repo.

@DavidDaish DavidDaish closed this Mar 25, 2020
@DavidDaish DavidDaish reopened this Mar 25, 2020
@DavidDaish
Copy link
Author

Whoops, closed it because I didn't think the newest commit would be included in the pull request.

@luzpaz
Copy link

luzpaz commented May 1, 2020

Any traction on this?

Copy link

@DrInfiniteExplorer DrInfiniteExplorer left a 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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 .

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)

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

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

Copy link

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

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) && \

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 && \

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?

@luzpaz
Copy link

luzpaz commented Jan 3, 2021

@kkremitzki shall we?

@adrianinsaval
Copy link
Member

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.
Dockerfile.txt
I'm a total docker newbie so forgive if I'm saying silly things

@DrInfiniteExplorer
Copy link

@adrianinsaval I think the original dockerfile was intended to create a setup with the exact tools/versions desired.
If yours works and it's simpler I personally wouldn't mind it. But I'm no expert either :P

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?
Would you mind sending a PR of your own? Core FreeCad devs don't seem to like/understand the advantages of images (seeing that they have ignored this PR for so long :P ), but another PR might help prioritize it!

@adrianinsaval
Copy link
Member

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?

@DrInfiniteExplorer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants