Files
blender-docker/Dockerfile
T

48 lines
1.4 KiB
Docker

FROM python:latest AS b3dock
# Setup all software version request
ARG b3d_vs_major=5.2
ARG b3d_vs_minor=0
LABEL Author="stilobique"
LABEL Title="Blender Docker for Unit Test"
LABEL maintainer="Aurelien Vaillant contact@aurelien-vaillant.net"
#ENV TZ=Europe/Paris
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
## 01. Start First stage to build blender
# Install dependencies
RUN apt-get update && apt-get install -y git git-lfs
# Compile Blender
RUN git clone --depth 1 --branch v${b3d_vs_major}.${b3d_vs_minor} \
https://projects.blender.org/blender/blender.git /opt/blender
# Get dependencies
RUN python /opt/blender/build_files/build_environment/install_linux_packages.py
RUN cd /opt/blender && make update
RUN cd /opt/blender && make -j$(nproc)
## 02. Build optimissed image
## Setup a Multistage optimisation
FROM ubuntu:25.04 AS final
RUN apt-get update && apt-get install -y python3
COPY --from=b3dock /opt/blender/build_files/build_environment/install_linux_packages.py /media/install_linux_packages.py
RUN python3 /media/install_linux_packages.py && \
rm /media/install_linux_packages.py && \
apt --purge remove python3
RUN useradd -m -s /bin/bash bld
USER bld
COPY --from=b3dock /opt/build_linux/bin /opt/blender
# ARG b3d_vs_major
# ENV B3D_ADDON_PATH="/home/bld/.config/blender/${b3d_vs_major}/scripts/addons"
# Working Directory setup
WORKDIR /opt/blender