Compile on Docker/es

Resumen
Entre las opciones para componer e instalar FreeCAD, existe la opción de utilizar Docker. Este método es principalmente útil para los desarrolladores de FreeCAD, utilizando ordenadores Linux o Mac OS.

Beneficios
All of FreeCAD's dependencies are already installed, compatible with each other, and configured appropriately, allowing you to get started developing very quickly.
 * The dependencies 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.

Docker Repositorio

 * Original: https://gitlab.com/daviddaish/freecad_docker_env
 * Official: https://GitHub.com/FreeCAD/Docker

Prerequisitos

 * 10 GB de almacenamiento libre
 * Docker

Descargar la fuente
La mejor manera de obtener el código fuente de FreeCAD es clonar el repositorio Git. Para ello se necesita el programa que puede instalarse fácilmente en la mayoría de las distribuciones de Linux y Mac OS, y también puede obtenerse en el sitio web oficial.

Esto colocará una copia de la última versión del código fuente de FreeCAD en un nuevo directorio llamado.

Para más información sobre el uso de Git y la contribución de código al proyecto, véase Gestión de código fuente.

Source archive
Alternatively you can download the source as an archive, a or  file, and unpack it in the desired directory.

Create build directory
Create a directory to hold your compiled FreeCAD source.

Pull Docker image
Pull the Docker image. (Official image coming soon.)

Allow access to your window manager
In order for FreeCAD to launch it's GUI from within the Docker container, you need to give Docker access permissions to your window manager. In most Linux distributions, this is the X window system. You can use the below command to allow blanket access to X, until you reboot or logoff your computer.

If you're connected to any untrusted systems, such as via, this will make you vulnerable to malicious code. Either close any connections, or look into more secure xhost permissions, which is outside the scope of this tutorial.

Mac OS users
For those using Mac OS, the X window system may not be installed. The XQuartz project is a long running open source project that will allow you to add it to your computer. You can find it here.

Launch the docker image
Assign environment variables so the Docker container will mount FreeCAD's source code, and build directory. In addition, you can mount an extra directory to contain any files you'd like to use for testing purposes. In the below snippet, we've left it as your home directory as a simple default.

Launch the Docker image.

Build FreeCAD
You can build FreeCAD using the installed build script, or using your preferred method.

Run FreeCAD
Once FreeCAD has been built, it can be run as normal.

You can find the attached directories in the directory.

Discussion

 * Docker env build container
 * VSCode setup with Docker (1)
 * VSCode setup with Docker (2)

Related

 * AppImage