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 \ libtool \
libudev-dev \ libudev-dev \
libwayland-dev \ libwayland-dev \
libwebkit2gtk-4.0-dev \ libwebkit2gtk-4.1-dev \
libxkbcommon-dev \ libxkbcommon-dev \
locales \ locales \
locales-all \ locales-all \
@ -86,10 +86,16 @@ SHELL ["/bin/bash", "-l", "-c"]
ARG USER=root ARG USER=root
ARG UID=0 ARG UID=0
ARG GID=0 ARG GID=0
RUN [[ "$UID" != "0" ]] \ RUN if [[ "$UID" != "0" ]]; then \
&& groupadd -f -g $GID $USER \ # Create group if it doesn't exist \
&& useradd -u $UID -g $GID $USER 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 # Using an entrypoint instead of CMD because the binary
# accepts several command line arguments. # accepts several command line arguments.
ENTRYPOINT ["/OrcaSlicer/build/package/bin/orca-slicer"] ENTRYPOINT ["/OrcaSlicer/build/package/bin/orca-slicer"]