-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
116 lines (95 loc) · 2.96 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
FROM ubuntu:jammy-20231211.1 as builder
RUN apt update && apt install -y \
build-essential \
cmake \
git \
libboost-all-dev \
libegl-dev \
libdbus-1-dev \
libembree-dev \
libepoxy-dev \
libfreetype6-dev \
libjpeg-dev \
libopenimageio-dev \
libpng-dev \
libpugixml-dev \
libvulkan-dev \
libwayland-dev \
libx11-dev \
libxxf86vm-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libxkbcommon-dev \
libtbb-dev \
libzstd-dev \
linux-libc-dev \
python3-dev \
python3-pip \
subversion \
wayland-protocols \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root/blender-git
RUN git clone -b v3.6.7 --depth 1 https://projects.blender.org/blender/blender.git
# Add the libs recommended by blender compilation guide
WORKDIR /root/blender-git/lib
ENV LC_ALL=en_US.UTF-8
RUN svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_x86_64_glibc_228
WORKDIR /root/blender-git/blender
RUN make update
# RUN git submodule update --init --recursive
# install a fake pass-thru sudo command
RUN echo '#!/bin/bash' > /usr/local/bin/sudo
RUN echo "exec \"\$@\"" >> /usr/local/bin/sudo
RUN chmod +x /usr/local/bin/sudo
# install packages
RUN ./build_files/build_environment/install_linux_packages.py && rm -rf /var/lib/apt/lists/*
WORKDIR /root/blender-git/cmake
# Fix error for numpy version wrong
# (compiled against API version 0x10 instead of 0xe)
RUN python3 -m pip install numpy --upgrade
# Configure build
RUN cmake ../blender \
-DWITH_PYTHON_INSTALL=OFF \
-DWITH_AUDASPACE=ON \
-DWITH_PYTHON_MODULE=ON \
-DWITH_MOD_OCEANSIM=OFF \
-DWITH_MEM_JEMALLOC=OFF
# Build blender from source
RUN make -j16
RUN make install
# Create the whl file
RUN python3 ../blender/build_files/utils/make_bpy_wheel.py bin/
RUN python3 -m pip install ./bin/bpy-*.whl
# Start fresh, discard the (huge) build files
FROM ubuntu:jammy-20231211.1 as runner
RUN apt update && apt install -y \
ffmpeg \
libsm6 \
libxkbcommon-x11-0 \
libxext6 \
libxfixes3 \
libxi6 \
libxxf86vm-dev \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip
WORKDIR /app/
COPY setup.py requirements.txt test /app/
COPY pkvid /app/pkvid
# Install requirements
RUN python3 -m pip install -r requirements.txt
# Install bpy
COPY --from=builder /root/blender-git/cmake/bin/bpy-*.whl /
RUN python3 -m pip install /bpy-*.whl
# Clean up alsa warnings
RUN echo "pcm.dummy {\n type hw\n card 0\n}\npcm.!default {\n type plug\n slave {\n pcm \"dummy\"\n }\n}\n" > /usr/share/alsa/alsa.conf
RUN mkdir /root/.config
RUN echo "[general]\nrt-prio = 0" > /root/.config/alsoft.conf
# Install pkvid
RUN python3 -m pip install -e .
WORKDIR /mnt
ENTRYPOINT [ "pkvid" ]
CMD [ "pkvid.yaml" ]