mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-13 19:01:21 +00:00
The ubuntu:24.04 base image has a built-in ubuntu user with UID 1000, so the Dockerfile skips creating the host user and `docker run -u "$USER"` cannot find it. Run the container with the numeric UID and GID instead, and set HOME and the working directory to the bind-mounted home.
32 lines
1.3 KiB
Bash
Executable File
32 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -x
|
|
# Just in case, here's some other things that might help:
|
|
# Force the container's hostname to be the same as your workstation
|
|
# -h $HOSTNAME \
|
|
# If there's problems with the X display, try this
|
|
# -v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
# If you get an error like "Authorization required, but no authorization protocol specified," run line 9 in your terminal before rerunning this program
|
|
# xhost +local:docker
|
|
docker run \
|
|
`# Use the hosts networking. Printer wifi and also dbus communication` \
|
|
--net=host \
|
|
`# Some X installs will not have permissions to talk to sockets for shared memory` \
|
|
--ipc host \
|
|
`# Run as your workstations UID and GID to keep permissions the same.` \
|
|
`# Numeric IDs work even when the image has no user with your name` \
|
|
-u "$(id -u):$(id -g)" \
|
|
-e HOME="/home/$USER" \
|
|
-w "/home/$USER" \
|
|
`# Bind mount your home directory into the container for loading/saving files` \
|
|
-v "$HOME:/home/$USER" \
|
|
`# Pass the X display number to the container` \
|
|
-e DISPLAY="$DISPLAY" \
|
|
`# It seems that libGL and dbus things need privileged mode` \
|
|
--privileged=true \
|
|
`# Attach tty for running orca slicer with command line things` \
|
|
-ti \
|
|
`# Clean up after yourself` \
|
|
--rm \
|
|
`# Pass all parameters from this script to the orca slicer ENTRYPOINT binary` \
|
|
orcaslicer "$@"
|