Debian Codegraph @

docker/Dockerfile_ubuntu

raw
1 ARG MESHROOM_VERSION
2 ARG AV_VERSION
3 ARG CUDA_VERSION
4 ARG UBUNTU_VERSION
5 FROM alicevision/meshroom-deps:${MESHROOM_VERSION}-av${AV_VERSION}-ubuntu${UBUNTU_VERSION}-cuda${CUDA_VERSION}
6 LABEL maintainer="AliceVision Team [email protected]"
7
8 # Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
9 # docker run -it --runtime nvidia -p 2222:22 --name meshroom -v</path/to/your/data>:/data alicevision/meshroom:develop-av2.2.8.develop-ubuntu20.04-cuda11.0
10 # ssh -p 2222 -X root@<docker host> /opt/Meshroom_bundle/Meshroom # Password is 'meshroom'
11
12 ENV MESHROOM_DEV=/opt/Meshroom \
13 MESHROOM_BUILD=/tmp/Meshroom_build \
14 MESHROOM_BUNDLE=/opt/Meshroom_bundle \
15 AV_INSTALL=/opt/AliceVision_install \
16 QT_DIR=/opt/Qt/6.8.3/gcc_64 \
17 PATH="${PATH}:${MESHROOM_BUNDLE}"
18
19 COPY *.txt *.md *.py ${MESHROOM_DEV}/
20 COPY ./docs ${MESHROOM_DEV}/docs
21 COPY ./meshroom ${MESHROOM_DEV}/meshroom
22 COPY ./tests ${MESHROOM_DEV}/tests
23 COPY ./bin ${MESHROOM_DEV}/bin
24
25 WORKDIR ${MESHROOM_DEV}
26
27 RUN python setup.py install_exe -d "${MESHROOM_BUNDLE}" && \
28 find ${MESHROOM_BUNDLE} -name "*Qt6Web*" -delete && \
29 find ${MESHROOM_BUNDLE} -name "*Qt6Designer*" -delete && \
30 rm -rf ${MESHROOM_BUNDLE}/lib/PySide6/typesystems/ \
31 ${MESHROOM_BUNDLE}/lib/PySide6/examples/ \
32 ${MESHROOM_BUNDLE}/lib/PySide6/include/ \
33 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/translations/ \
34 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/resources/ \
35 ${MESHROOM_BUNDLE}/lib/PySide6/QtWeb* \
36 ${MESHROOM_BUNDLE}/lib/PySide6/rcc \
37 ${MESHROOM_BUNDLE}/lib/PySide6/designer
38
39 WORKDIR ${MESHROOM_BUILD}
40
41 # Move the bundled installation of AliceVision into Meshroom's bundle
42 RUN mkdir ${MESHROOM_BUNDLE}/aliceVision && \
43 mv /opt/AliceVision_bundle/* ${MESHROOM_BUNDLE}/aliceVision
44
45 # Build Meshroom plugins
46 RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"
47 RUN make "-j$(nproc)" QtAliceVision
48 RUN make "-j$(nproc)" && \
49 rm -rf "${MESHROOM_BUILD}" "${MESHROOM_DEV}" \
50 ${MESHROOM_BUNDLE}/aliceVision/share/doc \
51 ${MESHROOM_BUNDLE}/aliceVision/share/eigen3 \
52 ${MESHROOM_BUNDLE}/aliceVision/share/fonts \
53 ${MESHROOM_BUNDLE}/aliceVision/share/lemon \
54 ${MESHROOM_BUNDLE}/aliceVision/share/libraw \
55 ${MESHROOM_BUNDLE}/aliceVision/share/man/ \
56 aliceVision/share/pkgconfig
57
58 # PySide6: copy missing libQt63DQuickScene3D.so along with its dependencies to avoid runtime issues
59 RUN cp ${QT_DIR}/lib/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
60 mv ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6 && \
61 cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/lib/libQt6Concurrent.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
62 cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Animation/libQt63DAnimation.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
63 cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Core/libQt63DCore.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
64 cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Input/libQt63DInput.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
65 cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Logic/libQt63DLogic.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
66 cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Render/libQt63DRender.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs
67
68 # Enable SSH X11 forwarding, needed when the Docker image
69 # is run on a remote machine
70 RUN apt install ssh xauth && \
71 systemctl enable ssh && \
72 mkdir -p /run/sshd
73
74 RUN sed -i "s/^.*X11Forwarding.*$/X11Forwarding yes/; s/^.*X11UseLocalhost.*$/X11UseLocalhost no/; s/^.*PermitRootLogin prohibit-password/PermitRootLogin yes/; s/^.*X11UseLocalhost.*/X11UseLocalhost no/;" /etc/ssh/sshd_config
75 RUN echo "root:meshroom" | chpasswd
76
77 WORKDIR /root
78
79 EXPOSE 22
80 CMD ["/usr/sbin/sshd", "-D"]