CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.17k stars 289 forks source link

Installing cadquery in a custom Dockerfile #708

Open hexad opened 3 years ago

hexad commented 3 years ago

I use the cadquery editor in order to create shapes. However, i would like the scripts i make, to run outside the editor's sandbox.

I have managed to import cadquery, when i performed the conda installation, using: conda create -n cq21-jl3 -c conda-forge -c cadquery python=3.8 cadquery

However, i am still isolated in a conda environment, and my scripts don't run on the system's native environment.

So my next step was to look up the docker installation.

However, i do not want to have a docker image just for cadquery and jupyter notebook.

First of all, i am not interested in jupyter, i just want to run my scripts. In this case, the docker image in the official docs would work, but i am restricted only to cadquery for this image.

So what i would like, is to add cadquery to an existing dockerfile i use.

I searched online for the bwalter42/jupyter_cadquery image, to see if i could take a look at the dockefile, to add to my existing one. But i didn't have any luck.

Does anyone know how i can add cadquery to an existing dockerfile?

jmwright commented 3 years ago

@RubenRubens created a dockerfile here that contains just CadQuery.

hexad commented 3 years ago

@jmwright Thank you. I see that he still uses it in a conda environment inside docker. So there's no escaping conda as far as i can tell, is this correct?

jmwright commented 3 years ago

So there's no escaping conda as far as i can tell, is this correct?

Correct. OCP (our bindings to the OCCT CAD kernel) has a lot of dependencies and complex build/runtime environments. There is a desire on the part of the community to simplify installation, but Anaconda is required still.

fedorkotov commented 3 years ago

The only (easy) way to use CadQuery is conda (see #153). Also take look at mamba (#691) it is much faster.

hexad commented 3 years ago

Thank you guys. And could i ask for one more clarification. My dockerfile uses FROM Ubuntu as the base OS, while this dockerfile uses FROM continuumio/miniconda3.

I know the fact that i can have two FROM commands, but is step necessary? Do you think i can have one FROM ubuntu and keep the rest the same as this dockerfile?

jmwright commented 3 years ago

@hexad I think the miniconda3 image only comes in Alpine and Debian variants. If you make sure Miniconda is installed, the same commands should work with your Ubuntu based docker file. I haven't tried it though.

RubenRubens commented 3 years ago

If you are interested, consider checking out this repo