Fix build and documente check info
This commit is contained in:
+49
-8
@@ -7,9 +7,10 @@ ARG b3d_vs_minor=0
|
|||||||
LABEL Author="stilobique"
|
LABEL Author="stilobique"
|
||||||
LABEL Title="Blender Docker for Unit Test"
|
LABEL Title="Blender Docker for Unit Test"
|
||||||
|
|
||||||
ENV TZ=Europe/Paris
|
#ENV TZ=Europe/Paris
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
## 01. Start First stage to build blender
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
@@ -36,21 +37,61 @@ RUN git clone --depth 1 --branch v${b3d_vs_major}.${b3d_vs_minor} \
|
|||||||
https://projects.blender.org/blender/blender.git /opt/blender
|
https://projects.blender.org/blender/blender.git /opt/blender
|
||||||
|
|
||||||
RUN cd /opt/blender && make update
|
RUN cd /opt/blender && make update
|
||||||
RUN cd /opt/blender && make
|
RUN cd /opt/blender && make -j$(nproc)
|
||||||
|
|
||||||
|
|
||||||
|
## 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/ \;
|
||||||
|
|
||||||
|
|
||||||
|
## 03. Build optimissed image
|
||||||
## Setup a Multistage optimisation
|
## Setup a Multistage optimisation
|
||||||
FROM ubuntu:25.04
|
FROM ubuntu:25.04
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libx11-6 \
|
||||||
libxi6 \
|
libxi6 \
|
||||||
libxxf86vm1 \
|
libxxf86vm1 \
|
||||||
libxrender1
|
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/*
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
RUN echo "/usr/local/lib/blender" > /etc/ld.so.conf.d/blender.conf \
|
||||||
|
&& ldconfig
|
||||||
|
|
||||||
USER bld
|
|
||||||
COPY --from=b3dock /opt/build_linux/bin/blender /opt/blender
|
|
||||||
ARG b3d_vs_major
|
ARG b3d_vs_major
|
||||||
ENV B3D_ADDON_PATH="/home/bld/.config/blender/${b3d_vs_major}/scripts/addons"
|
ENV B3D_ADDON_PATH="/home/bld/.config/blender/${b3d_vs_major}/scripts/addons"
|
||||||
|
|
||||||
|
USER bld
|
||||||
# Working Directory setup
|
# Working Directory setup
|
||||||
WORKDIR /
|
WORKDIR /home/bld
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/blender"]
|
||||||
|
CMD ["--version"]
|
||||||
@@ -26,3 +26,8 @@ Call this function with blender inside this container
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
/opt/blender/blender --background --python "install.py"
|
/opt/blender/blender --background --python "install.py"
|
||||||
````
|
````
|
||||||
|
|
||||||
|
# Check Image build
|
||||||
|
```shell
|
||||||
|
docker run --rm stilobique/blender:5.1.2 blender --version
|
||||||
|
```
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
LIB_PATHS="$(find /opt/blender-libs -type d -name lib | paste -sd: -)"
|
||||||
|
export LD_LIBRARY_PATH="${LIB_PATHS}:${LD_LIBRARY_PATH}"
|
||||||
|
|
||||||
|
exec /usr/local/bin/blender "$@"
|
||||||
Reference in New Issue
Block a user