Update the docker process, compile a blender version and keep only package request

This commit is contained in:
Aurelien Vaillant
2021-11-29 15:26:47 +01:00
parent d1821594c0
commit c197b177f2
+39 -16
View File
@@ -1,4 +1,4 @@
FROM ubuntu:21.10 AS blender
FROM ubuntu:latest AS blender
# Setup all software version request
ARG b3d_vs_major=2.90
@@ -7,27 +7,50 @@ ARG b3d_vs_minor=0
LABEL Author="stilobique"
LABEL Title="Blender Docker for Unit Test"
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install dependencies
RUN apt-get update && apt-get install -y \
zip \
wget \
bzip2 \
zlib1g-dev \
build-essential \
libxi-dev \
gcc \
git \
cmake \
libc6-dev \
libx11-dev \
subversion \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxxf86vm-dev \
libxinerama-dev \
libglew-dev \
libxi-dev \
python3
# Compile Blender
RUN mkdir /opt/blender-git/ && cd /opt/blender-git/ \
&& git clone -b v${b3d_vs_major}.${b3d_vs_minor} --depth 1 https://git.blender.org/blender.git \
&& git config --global user.email "a.vaillant.moderlab@gmail.com" \
&& git config --global user.name "Aurelien Vaillant" \
&& mkdir /opt/blender-git/lib \
&& cd /opt/blender-git/lib \
&& svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64 \
&& cd /opt/blender-git/blender \
&& git submodule update --init --recursive \
&& make
#RUN cd /opt/blender-git/build_linux/bin \
# && ls -la \
# Setup a Multistage optimisation
FROM ubuntu:latest
COPY --from=blender /opt/blender-git/build_linux/bin /opt/blender
RUN apt-get update && apt-get install -y \
libxi6 \
libxxf86vm1 \
libxrender1 \
libgl1-mesa-glx
# Install Blender
RUN wget https://download.blender.org/release/Blender${b3d_vs_major}/blender-${b3d_vs_major}.${b3d_vs_minor}-linux-x64.tar.xz -P /opt \
&& tar -xvf /opt/blender-${b3d_vs_major}.${b3d_vs_minor}-linux-x64.tar.xz -C /opt \
&& rm -rf /opt/blender-${b3d_vs_major}.${b3d_vs_minor}-linux-x64.tar.xz \
&& mv /opt/blender-${b3d_vs_major}.${b3d_vs_minor}-linux-x64 /opt/blender
# Setup a Multistage optimisation
FROM ubuntu:21.10
COPY --from=blender /opt/blender/ /
# Working Directory setup
WORKDIR /