commit e256867bab6d64fbbf4d9267d09befe9579a0158 Author: Brian C. Lane <bcl@brianlane.com> Date: Sun, 20 Feb 2022 15:35:41 -0800 Initial commit Diffstat:
A | Containerfile | | | 29 | +++++++++++++++++++++++++++++ |
A | README.md | | | 1 | + |
A | run-prusa-slicer | | | 14 | ++++++++++++++ |
3 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/Containerfile b/Containerfile @@ -0,0 +1,29 @@ +# Run Prusa Slicer in a container +# +# Based on Jessie Frazelle's post: +# https://blog.jessfraz.com/post/docker-containers-on-the-desktop/ +FROM debian:latest +LABEL maintainer "Brian C. Lane <bcl@brianlane.com>" + +RUN apt-get update && apt-get install -y \ + prusa-slicer \ + locales \ + && rm -rf /var/lib/apt/lists/* + +# Update the locale +RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.utf8 \ + && /usr/sbin/update-locale LANG=en_US.UTF-8 + +ENV LC_ALL en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV HOME /home/user +ENV USER user + +RUN groupadd -g 1000 user \ + && useradd -u 1000 -g 1000 --create-home --home-dir $HOME user \ + && chown -R user:user $HOME +RUN passwd -d root + +WORKDIR $HOME +USER user diff --git a/README.md b/README.md @@ -0,0 +1 @@ +Files for https://www.brianlane.com/post/prusa-slicer/ diff --git a/run-prusa-slicer b/run-prusa-slicer @@ -0,0 +1,14 @@ +#!/bin/sh +CMD="" +if [ -z "$1" ]; then + CMD=prusa-slicer +else + CMD="$*" +fi +xhost +si:localuser:"$USER" +podman run --rm -it --userns=keep-id -v "$HOME/Downloads:/home/user/Downloads" \ +-v "$PWD/PrusaSlicer:/home/user/.config/PrusaSlicer" \ +-v /tmp/.X11-unix:/tmp/.X11-unix \ +-e "DISPLAY=unix$DISPLAY" \ +prusa-slicer "$CMD" +xhost -si:localuser:"$USER"