WIP Docker building
This commit is contained in:
+15
-17
@@ -1,4 +1,4 @@
|
||||
FROM python:latest AS b3dock
|
||||
FROM ubuntu:25.10 AS b3dock
|
||||
|
||||
# Setup all software version request
|
||||
ARG b3d_vs_major=5.2
|
||||
@@ -6,36 +6,34 @@ ARG b3d_vs_minor=0
|
||||
|
||||
LABEL Author="stilobique"
|
||||
LABEL Title="Blender Docker for Unit Test"
|
||||
LABEL maintainer="Aurelien Vaillant contact@aurelien-vaillant.net"
|
||||
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
|
||||
RUN apt-get update && apt-get install -y git git-lfs python3 sudo
|
||||
|
||||
# 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
|
||||
COPY ./scripts/gen_packages_txt.py /opt/blender/build_files/build_environment/gen_packages_txt.py
|
||||
RUN cd /opt/blender/build_files/build_environment && \
|
||||
python gen_packages_txt.py
|
||||
RUN cd /opt/blender/build_files/build_environment && chmod a+x ./install_linux_packages.py && \
|
||||
python install_linux_packages.py
|
||||
|
||||
RUN cd /opt/blender && make update
|
||||
RUN cd /opt/blender && make -j$(nproc)
|
||||
https://projects.blender.org/blender/blender.git /opt/blender && \
|
||||
chmod a+x /opt/blender/build_files/build_environment/install_linux_packages.py && \
|
||||
python3 /opt/blender/build_files/build_environment/install_linux_packages.py
|
||||
|
||||
RUN cd /opt/blender && \
|
||||
make update && \
|
||||
make -j$(nproc)
|
||||
|
||||
|
||||
## 02. Build optimissed image
|
||||
## Setup a Multistage optimisation
|
||||
FROM ubuntu:25.04 AS final
|
||||
FROM ubuntu:25.10 AS final
|
||||
|
||||
COPY --from=b3dock /opt/blender/build_files/build_environment/packages.txt /tmp/packages.txt
|
||||
RUN apt-get update && xargs -a /tmp/packages.txt apt-get install -y
|
||||
#COPY --from=b3dock /opt/blender/build_files/build_environment/packages.txt /tmp/packages.txt
|
||||
COPY --from=b3dock /opt/blender/build_files/build_environment/install_linux_packages.py /tmp/install_linux_packages.py
|
||||
RUN apt-get update && apt-get install -y python3
|
||||
RUN python3 /tmp/install_linux_packages.py --no-sudo
|
||||
|
||||
RUN useradd -m -s /bin/bash bld
|
||||
|
||||
|
||||
Reference in New Issue
Block a user