-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.dev
More file actions
103 lines (82 loc) · 3.62 KB
/
Dockerfile.dev
File metadata and controls
103 lines (82 loc) · 3.62 KB
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
# ------------------------------
# Stage 1: Build OpenMVG/OpenMVS
# ------------------------------
FROM ubuntu:22.04 AS cv_builder
ENV DEBIAN_FRONTEND=noninteractive
# Install only build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake build-essential git ca-certificates \
python3-dev libboost-all-dev libopencv-dev \
libjpeg-dev libpng-dev libtiff-dev libglu1-mesa-dev \
libglew-dev libglfw3-dev coinor-libclp-dev libceres-dev \
libcgal-dev libcgal-qt5-dev graphviz liblemon-dev \
pkg-config && \
rm -rf /var/lib/apt/lists/*
# Build VCG library
RUN git clone --depth=1 https://github.com/cdcseacave/VCG.git /vcglib
# Build OpenMVG
RUN git clone --recursive --depth=1 https://github.com/openMVG/openMVG.git /openMVG && \
mkdir -p /openMVG_build && cd /openMVG_build && \
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
/openMVG/src && \
make -j$(nproc) && \
make install
# Build OpenMVS
RUN git clone --branch develop --depth=1 https://github.com/cdcseacave/openMVS.git /openMVS && \
sed -i 's|<CGAL/AABB_traits_3.h>|<CGAL/AABB_tree.h>|g' /openMVS/libs/MVS/SceneReconstruct.cpp && \
sed -i 's|<CGAL/AABB_triangle_primitive_3.h>|<CGAL/AABB_triangle_primitive.h>|g' /openMVS/libs/MVS/SceneReconstruct.cpp && \
mkdir -p /openMVS_build && cd /openMVS_build && \
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DOpenMVG_DIR=/usr/local/lib/cmake/openmvg \
-DVCG_ROOT=/vcglib \
/openMVS && \
make -j$(nproc) && \
make install
# ------------------------------
# Stage 3: Build Blender (minimal)
# ------------------------------
FROM linuxserver/blender:4.4.3 AS blender_builder
# -------------------------
# Stage 4: Dev Environment
# -------------------------
FROM ubuntu:22.04 AS final
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN sed -i'' 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.list
# Create non-root user
RUN groupadd -r appuser && useradd -r -g appuser -s /bin/false appuser
ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive
# Install only runtime dependencies
# Seperate for cache issues
RUN apt-get -y update
RUN apt-get install -y --no-install-recommends \
libcgal-qt5-dev libceres2 libboost-system1.74.0 libboost-filesystem1.74.0 \
build-essential \
libboost-program-options1.74.0 libboost-serialization1.74.0 \
libopencv-core4.5d libopencv-imgproc4.5d libopencv-imgcodecs4.5d \
libjpeg8 libpng16-16 libtiff5 libglu1-mesa libglew2.2 \
libglfw3 libgomp1 ca-certificates curl wget libboost-all-dev libopencv-dev \
xorg && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN wget https://go.dev/dl/go1.23.8.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.23.8.linux-amd64.tar.gz && \
rm -rf go1.23.8.linux-amd64.tar.gz && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy OpenMVG and OpenMVS builds from cv_builder
COPY --from=cv_builder /openMVG_build/Linux-x86_64-RELEASE /usr/local/bin
COPY --from=cv_builder /openMVS_build/bin /usr/local/bin
# Copy Blender (only essential parts)
COPY --from=blender_builder /blender /opt/blender
ENV PATH="/opt/blender:$PATH"
ENV PATH="$PATH:/usr/local/go/bin:/root/go/bin"
RUN go install github.com/pressly/goose/v3/cmd/goose@latest && \
go install github.com/joho/godotenv/cmd/godotenv@latest && \
go install github.com/nikolaydubina/go-cover-treemap@latest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
WORKDIR /app
EXPOSE 3333
CMD ["tail", "-f", "/dev/null"]