fix docker build

This commit is contained in:
SoftFever 2025-03-20 23:30:27 +08:00
parent 70931e5321
commit 671d3d8f70

View File

@ -40,7 +40,7 @@ RUN apt-get update && apt-get install -y \
libtool \
libudev-dev \
libwayland-dev \
libwebkit2gtk-4.0-dev \
libwebkit2gtk-4.1-dev \
libxkbcommon-dev \
locales \
locales-all \
@ -86,10 +86,16 @@ SHELL ["/bin/bash", "-l", "-c"]
ARG USER=root
ARG UID=0
ARG GID=0
RUN [[ "$UID" != "0" ]] \
&& groupadd -f -g $GID $USER \
&& useradd -u $UID -g $GID $USER
RUN if [[ "$UID" != "0" ]]; then \
# Create group if it doesn't exist \
groupadd -f -g $GID $USER; \
# Check if user with this UID already exists \
if getent passwd $UID > /dev/null 2>&1; then \
echo "User with UID $UID already exists, skipping user creation"; \
else \
useradd -u $UID -g $GID $USER; \
fi \
fi
# Using an entrypoint instead of CMD because the binary
# accepts several command line arguments.
ENTRYPOINT ["/OrcaSlicer/build/package/bin/orca-slicer"]