REfactoring to work with blender 5.1.x
This commit is contained in:
+33
-35
@@ -39,59 +39,57 @@ RUN git clone --depth 1 --branch v${b3d_vs_major}.${b3d_vs_minor} \
|
||||
RUN cd /opt/blender && make update
|
||||
RUN cd /opt/blender && make -j$(nproc)
|
||||
|
||||
# Check if this folder exist
|
||||
RUN ls /opt/build_linux/bin/
|
||||
|
||||
## 02. Collecte all dependencies
|
||||
FROM b3dock AS collector
|
||||
# Rassemble toutes les .so des precompiled libs dans un dossier plat
|
||||
# -not -type d : ignore les dossiers
|
||||
# cp -P : préserve les symlinks relatifs (libFoo.so -> libFoo.so.1.0)
|
||||
RUN mkdir -p /collected-libs && \
|
||||
find /opt/blender/lib/linux_x64 \
|
||||
-name "*.so*" \
|
||||
-not -type d \
|
||||
-exec cp -P {} /collected-libs/ \;
|
||||
### 02. Collecte all dependencies
|
||||
#FROM b3dock AS collector
|
||||
#
|
||||
#RUN apt-get update && apt-get install -y \
|
||||
# binutils \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
#COPY collect_deps.sh /usr/local/bin/collect_deps.sh
|
||||
#RUN chmod +x /usr/local/bin/collect_deps.sh
|
||||
#
|
||||
#RUN collect_deps.sh /opt/build_linux/bin/blender /collected-libs
|
||||
#
|
||||
## Strip des symboles debug
|
||||
#RUN find /collected-libs -name "*.so*" -not -type l \
|
||||
# -exec strip --strip-debug {} \; 2>/dev/null || true
|
||||
#
|
||||
#RUN strip --strip-debug /opt/build_linux/bin/blender 2>/dev/null || true
|
||||
|
||||
|
||||
## 03. Build optimissed image
|
||||
## Setup a Multistage optimisation
|
||||
FROM ubuntu:25.04
|
||||
FROM ubuntu:25.04 AS final
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libx11-6 \
|
||||
libsm6 \
|
||||
libxi6 \
|
||||
libxxf86vm1 \
|
||||
libxrender1 \
|
||||
libxrandr2 \
|
||||
libxinerama1 \
|
||||
libxcursor1 \
|
||||
libxfixes3 \
|
||||
libxkbcommon0 \
|
||||
libwayland-client0 \
|
||||
libwayland-egl1 \
|
||||
libegl1 \
|
||||
libgl1 \
|
||||
libdbus-1-3 \
|
||||
libxcb1 \
|
||||
libtbb12 \
|
||||
libopenal1 \
|
||||
libsm6 \
|
||||
libice6 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
libgl1
|
||||
|
||||
RUN useradd -m -s /bin/bash bld
|
||||
|
||||
COPY --from=b3dock /opt/build_linux/bin/blender /usr/local/bin/blender
|
||||
COPY --from=collector /collected-libs /usr/local/lib/blender
|
||||
#COPY --from=b3dock /opt/build_linux/bin/blender /usr/local/bin/blender
|
||||
COPY --from=b3dock /opt/build_linux/bin /opt/blender
|
||||
RUN ls -la /opt/blender
|
||||
#COPY --from=collector /collected-libs /usr/local/lib/blender
|
||||
|
||||
RUN echo "/usr/local/lib/blender" > /etc/ld.so.conf.d/blender.conf \
|
||||
&& ldconfig
|
||||
RUN #echo "/usr/local/lib/blender" > /etc/ld.so.conf.d/blender.conf \
|
||||
# && ldconfig
|
||||
|
||||
ARG b3d_vs_major
|
||||
ENV B3D_ADDON_PATH="/home/bld/.config/blender/${b3d_vs_major}/scripts/addons"
|
||||
# ARG b3d_vs_major
|
||||
# ENV B3D_ADDON_PATH="/home/bld/.config/blender/${b3d_vs_major}/scripts/addons"
|
||||
|
||||
USER bld
|
||||
# Working Directory setup
|
||||
WORKDIR /home/bld
|
||||
WORKDIR /opt/blender
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/blender"]
|
||||
CMD ["--version"]
|
||||
#ENTRYPOINT ["/usr/local/bin"]
|
||||
#CMD ["--version"]
|
||||
Reference in New Issue
Block a user