mirror of
https://gitlab.com/stilobique/blender-docker.git
synced 2026-05-28 04:37:47 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a16e9de93 | |||
| e41f332f60 |
@@ -1,23 +1,23 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Build Blender" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
<configuration default="false" name="Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||||
<deployment type="dockerfile">
|
<deployment type="dockerfile">
|
||||||
<settings>
|
<settings>
|
||||||
<option name="imageTag" value="stilobique/blender:3.4.0" />
|
<option name="imageTag" value="stilobique/blender:3.6.10" />
|
||||||
<option name="buildArgs">
|
<option name="buildArgs">
|
||||||
<list>
|
<list>
|
||||||
<DockerEnvVarImpl>
|
<DockerEnvVarImpl>
|
||||||
<option name="name" value="b3d_vs_major" />
|
<option name="name" value="b3d_vs_major" />
|
||||||
<option name="value" value="3.4" />
|
<option name="value" value="3.6" />
|
||||||
</DockerEnvVarImpl>
|
</DockerEnvVarImpl>
|
||||||
<DockerEnvVarImpl>
|
<DockerEnvVarImpl>
|
||||||
<option name="name" value="b3d_vs_minor" />
|
<option name="name" value="b3d_vs_minor" />
|
||||||
<option name="value" value="0" />
|
<option name="value" value="10" />
|
||||||
</DockerEnvVarImpl>
|
</DockerEnvVarImpl>
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
<option name="buildOnly" value="true" />
|
<option name="buildOnly" value="true" />
|
||||||
<option name="containerName" value="blender-latest" />
|
<option name="containerName" value="blender-latest" />
|
||||||
<option name="sourceFilePath" value="image/Dockerfile-build-blender" />
|
<option name="sourceFilePath" value="Dockerfile" />
|
||||||
<option name="volumeBindings">
|
<option name="volumeBindings">
|
||||||
<list>
|
<list>
|
||||||
<DockerVolumeBindingImpl>
|
<DockerVolumeBindingImpl>
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="Make Blender Cache" type="PythonConfigurationType" factoryName="Python">
|
|
||||||
<module name="blender-docker" />
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
|
||||||
</envs>
|
|
||||||
<option name="SDK_HOME" value="" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="IS_MODULE_SDK" value="true" />
|
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/generate-image-repo.py" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
|
||||||
<option name="MODULE_MODE" value="false" />
|
|
||||||
<option name="REDIRECT_INPUT" value="false" />
|
|
||||||
<option name="INPUT_FILE" value="" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
||||||
+95
@@ -0,0 +1,95 @@
|
|||||||
|
FROM ubuntu:22.04 AS blender
|
||||||
|
|
||||||
|
# Setup all software version request
|
||||||
|
ARG b3d_vs_major=3.6
|
||||||
|
ARG b3d_vs_minor=10
|
||||||
|
ARG version=v${b3d_vs_major}.${b3d_vs_minor}
|
||||||
|
|
||||||
|
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 build-essential \
|
||||||
|
git \
|
||||||
|
git-lfs \
|
||||||
|
cmake \
|
||||||
|
python3 \
|
||||||
|
python3-dev \
|
||||||
|
cython3 \
|
||||||
|
sudo
|
||||||
|
|
||||||
|
RUN apt-get install -y libx11-dev \
|
||||||
|
libxxf86vm-dev \
|
||||||
|
libxcursor-dev \
|
||||||
|
libxi-dev \
|
||||||
|
libxrandr-dev \
|
||||||
|
libxinerama-dev \
|
||||||
|
libxkbcommon-dev \
|
||||||
|
libwayland-dev \
|
||||||
|
libdecor-0-dev \
|
||||||
|
wayland-protocols \
|
||||||
|
libdbus-1-dev \
|
||||||
|
libgl-dev \
|
||||||
|
libegl-dev
|
||||||
|
|
||||||
|
RUN apt-get install -y libjpeg-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libfreetype-dev \
|
||||||
|
libfontconfig-dev \
|
||||||
|
libzstd-dev \
|
||||||
|
libbz2-dev \
|
||||||
|
liblzma-dev \
|
||||||
|
libsdl2-dev \
|
||||||
|
libepoxy-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libhpdf-dev \
|
||||||
|
libpystring-dev
|
||||||
|
|
||||||
|
RUN apt-get install -y libopenjp2-7-dev \
|
||||||
|
libtiff-dev \
|
||||||
|
libjack-jackd2-dev \
|
||||||
|
libpulse-dev \
|
||||||
|
libopenal-dev \
|
||||||
|
libsndfile1-dev \
|
||||||
|
libjemalloc-dev \
|
||||||
|
libvulkan-dev \
|
||||||
|
libgmp-dev \
|
||||||
|
libpugixml-dev \
|
||||||
|
libfftw3-dev \
|
||||||
|
libpotrace-dev \
|
||||||
|
libyaml-cpp-dev \
|
||||||
|
libdeflate-dev
|
||||||
|
|
||||||
|
# ADD . /opt/blender-git
|
||||||
|
RUN git clone --depth 1 --branch ${version} https://projects.blender.org/blender/blender.git /opt/blender-git
|
||||||
|
|
||||||
|
# Use the local repo has current directory
|
||||||
|
#WORKDIR /opt/blender-git
|
||||||
|
|
||||||
|
# Compile Blender
|
||||||
|
RUN cd /opt/blender-git && \
|
||||||
|
sudo ./build_files/utils/make_update.py --use-linux-libraries
|
||||||
|
RUN cd /opt/blender-git && \
|
||||||
|
make
|
||||||
|
|
||||||
|
## Setup a Multistage optimisation
|
||||||
|
FROM ubuntu:22.04
|
||||||
|
COPY --from=blender /opt/build_linux/bin /opt/blender
|
||||||
|
ARG b3d_vs_major
|
||||||
|
ENV B3D_ADDON_PATH "$HOME/.config/blender/${b3d_vs_major}/scripts/addons"
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libxi6 \
|
||||||
|
libxxf86vm1 \
|
||||||
|
libxfixes3 \
|
||||||
|
libxkbcommon-x11-0 \
|
||||||
|
libjack0 \
|
||||||
|
pulseaudio \
|
||||||
|
libgl1-mesa-glx
|
||||||
|
# libxrender1 \
|
||||||
|
|
||||||
|
# Working Directory setup
|
||||||
|
WORKDIR /opt/blender
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
[](https://www.blender.org/download/)
|
[](https://www.blender.org/download/)
|
||||||
[](https://gitlab.com/stilobique/blender-docker/-/commits/main)
|
[](https://gitlab.com/stilobique/blender-docker/-/commits/main)
|
||||||
[](https://www.python.org/)
|
|
||||||
|
|
||||||
|
|
||||||
# Blender Docker
|
# Blender Docker
|
||||||
|
|||||||
+2
-34
@@ -1,40 +1,8 @@
|
|||||||
{
|
{
|
||||||
"tags":
|
"tags":
|
||||||
[{
|
[{
|
||||||
"b3d_vs_major": 3.4,
|
"b3d_vs_major": 3.6,
|
||||||
"b3d_vs_minor": 1
|
"b3d_vs_minor": 10
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.4,
|
|
||||||
"b3d_vs_minor": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.3,
|
|
||||||
"b3d_vs_minor": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.3,
|
|
||||||
"b3d_vs_minor": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.3,
|
|
||||||
"b3d_vs_minor": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.2,
|
|
||||||
"b3d_vs_minor": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.2,
|
|
||||||
"b3d_vs_minor": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.1,
|
|
||||||
"b3d_vs_minor": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"b3d_vs_major": 3.1,
|
|
||||||
"b3d_vs_minor": 0
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import docker
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def get_repo_container():
|
|
||||||
"""
|
|
||||||
- Check if a blender/csv image local exist
|
|
||||||
- If yes, check if a container exist
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
client = docker.from_env()
|
|
||||||
|
|
||||||
if os.environ.get('docker_hub_password'):
|
|
||||||
client.login(username=os.environ['docker_hub_user'], password=os.environ['docker_hub_password'])
|
|
||||||
|
|
||||||
dk_tags = 'stilobique/csv'
|
|
||||||
dk_container_name = 'blender-cache-repo'
|
|
||||||
dk_images_local = client.images.list(name=dk_tags)
|
|
||||||
dk_containers_local = client.containers.list(filters={'label': dk_container_name})
|
|
||||||
volumes = ["/scripts/:/scripts"]
|
|
||||||
commandes = ['bash', '/scripts/set_all_repository.sh']
|
|
||||||
|
|
||||||
if dk_containers_local:
|
|
||||||
# The container cache exist, used-it
|
|
||||||
client.containers.run(image=dk_tags, name=dk_container_name)
|
|
||||||
pass
|
|
||||||
elif dk_images_local:
|
|
||||||
# No container, but the image are build, start a container cache
|
|
||||||
client.containers.run(image=dk_tags, name=dk_container_name)
|
|
||||||
pass
|
|
||||||
|
|
||||||
else:
|
|
||||||
# No container, no image ; build a new image and start this cache
|
|
||||||
client.images.build(path="image", dockerfile="Dockerfile-csv", tag=f'{dk_tags}:latest', rm=True)
|
|
||||||
client.containers.run(image=dk_tags, name=dk_container_name, volumes=volumes, command=commandes)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# Make or update the docker container
|
|
||||||
get_repo_container()
|
|
||||||
print('Blender repo set')
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
FROM ubuntu:22.04 AS blender
|
|
||||||
|
|
||||||
# Setup all software version request
|
|
||||||
ARG b3d_vs_major=2.90
|
|
||||||
ARG b3d_vs_minor=0
|
|
||||||
ARG subversion=63014
|
|
||||||
|
|
||||||
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 \
|
|
||||||
build-essential \
|
|
||||||
gcc \
|
|
||||||
git \
|
|
||||||
cmake \
|
|
||||||
libc6-dev \
|
|
||||||
libx11-dev \
|
|
||||||
subversion \
|
|
||||||
libxrandr-dev \
|
|
||||||
libxcursor-dev \
|
|
||||||
libxxf86vm-dev \
|
|
||||||
libxinerama-dev \
|
|
||||||
libglew-dev \
|
|
||||||
libxi-dev \
|
|
||||||
python3
|
|
||||||
|
|
||||||
# Debug
|
|
||||||
RUN echo Build Blender v${b3d_vs_major}.${b3d_vs_minor}
|
|
||||||
|
|
||||||
ADD . /opt/blender-git
|
|
||||||
|
|
||||||
# Compile Blender
|
|
||||||
RUN cd /opt/blender-git/ \
|
|
||||||
&& git checkout v${b3d_vs_major}.${b3d_vs_minor} \
|
|
||||||
&& git config --global user.email "contact@aurelien-vaillant.net" \
|
|
||||||
&& git config --global user.name "Aurelien Vaillant" \
|
|
||||||
&& mkdir /opt/blender-git/lib \
|
|
||||||
&& cd /opt/blender-git/lib \
|
|
||||||
&& svn checkout -r${subversion} \
|
|
||||||
&& make
|
|
||||||
|
|
||||||
# Setup a Multistage optimisation
|
|
||||||
FROM ubuntu:22.04
|
|
||||||
COPY --from=blender /opt/blender-git/build_linux/bin /opt/blender
|
|
||||||
ARG b3d_vs_major
|
|
||||||
ENV B3D_ADDON_PATH "$HOME/.config/blender/${b3d_vs_major}/scripts/addons"
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
libxi6 \
|
|
||||||
libxxf86vm1 \
|
|
||||||
libxrender1 \
|
|
||||||
libgl1-mesa-glx
|
|
||||||
|
|
||||||
# Working Directory setup
|
|
||||||
WORKDIR /
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "------------------------------";
|
|
||||||
echo " > Get the Blender repository";
|
|
||||||
mkdir -p /opt/blender-git/lib
|
|
||||||
cd /opt.blender-git/lib || exit 1
|
|
||||||
git clone https://projects.blender.org/blender/blender.git
|
|
||||||
|
|
||||||
echo "------------------------------";
|
|
||||||
echo " > Get all Blender submodule";
|
|
||||||
cd /opt/blender-git/blender || exit 1
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
echo "------------------------------";
|
|
||||||
echo " > Get the all lib Blender (svn)";
|
|
||||||
cd /opt/blender-git/lib || exit 1
|
|
||||||
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
|
|
||||||
Reference in New Issue
Block a user