-
Notifications
You must be signed in to change notification settings - Fork 999
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
Added Docker support. #1004
base: master
Are you sure you want to change the base?
Added Docker support. #1004
Conversation
I don't know what you mean by "Software has dockerized" but I don't see how this can work. Printrun needs access to local files (STL and gcode), it needs to store configuration (in .config), it needs access to hardware (sleep inhibition, scan for devices, connect to newly plugged device) and needs to be able to run external processes for slicing. You've given it access to some temporary files, and access to a single serial port. I don't see how it's going to be usable at all. I don't have objection to docker in principle, but the way it's implemented here breaks the core functionality of the application. It also introduces a potential malware vector as the readme is asking people to download a docker image from a third party location that is not guaranteed to come from the source code here. I'm not really happy with this situation, and I don't see how anyone gains anything from it. |
Hello Kliment,
I mean of "Software has dockerized", you can use software inside of a docker container.
You can mount any local file to container while starting the container with "-v" parameter. Also, if we need some files be permenant we can use the volume for storing the files on host computer permenantly. For this we just need add another line of Dockerfile but in my opinion we should't. Any person wants to store any configuration file permenantly he can mount the file to container while he started container.
Also, you can connect any host devices to container with "--device" paramater. I wrote this in README.md.
Unfortunately, i can't promise the all of functions will running without exception when you using Printrun on the Docker container. But we can improvement the Docker image with any trouble. But i can't help for newly plugged devices mount to running container.
What you mean in hear run external processes for slicing?
I'm just wrote an example for my case. The "/dev/ttyUSB0" is my serial port to 3d printer's connected to my computer. These temporary files is for using the Pronterface. If you run a process inside of container and the process has graphical interface like Pronterface you mount the .X11-unix socket to container so when a process starting in the container it's graphical interface start on the your host device.
If you want use the Printrun utilities inside of Docker you needs a container image. git clone https://github.com/kliment/Printrun.git
cd Printrun
docker build -t printrun:latest .
docker run -ti --rm \
--device /dev/ttyUSB0 \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
printrun:latest On this option you pull the repo, and build container image with Dockerfile where inside of repository. Your other option is if you have pre-builded image and you can run container from this image directly. When you run This is Docker's official hub. So in our case when you run Only difference between pull requesting Dockerfile and other Dockerfile, one of them you copying source codes from inside of repository, in other you pulling the source code by git clone command. Of course we can connect the Docker hub to official Printrun repository. So any new commit on main repository automatically adapting to Docker image. If you look Docker hub, another Printrun image was uploaded to hub and pulled more than 100 times. So i think people like me need to a Docker image of Printrun. I hope I expressed myself clearly. Best regards. |
Software has dockerized. Dockerfile added. README.md updated.