@@ -50,15 +50,25 @@ Name: mbedx509\n\
5050Description: MbedTLS X509 Library\n \
5151Version: 3.4.0\n \
5252Libs: -L\$ {libdir} -lmbedx509\n \
53- Cflags: -I\$ {includedir}" > /usr/local/lib/pkgconfig/mbedx509.pc && \
54- rm -rf /opt/mbedtls
53+ Cflags: -I\$ {includedir}" > /usr/local/lib/pkgconfig/mbedx509.pc
54+
55+ # Fetch external dependencies
56+ RUN mkdir -p /opt/external && \
57+ # ezxml
58+ cd /opt/external && \
59+ git clone https://github.com/lumberjaph/ezxml.git && \
60+ # inih
61+ cd /opt/external && \
62+ git clone https://github.com/benhoyt/inih.git
5563
5664# Copy current directory contents into container
5765WORKDIR /opt
5866COPY . .
5967
60- # Build the application
61- RUN PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH ./scripts/build.sh --release --with-sod && \
68+ # Prepare and build the application
69+ RUN mkdir -p /etc/lightnvr /var/lib/lightnvr /var/log/lightnvr /var/run/lightnvr /var/lib/lightnvr/recordings && \
70+ chmod -R 777 /var/lib/lightnvr /var/log/lightnvr /var/run/lightnvr && \
71+ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH ./scripts/build.sh --release --with-sod && \
6272 ./scripts/install.sh --prefix=/
6373
6474# Stage 2: Minimal runtime image
@@ -73,7 +83,8 @@ RUN apt-get update && apt-get install -y \
7383 rm -rf /var/lib/apt/lists/*
7484
7585# Create necessary directories in runtime
76- RUN mkdir -p /etc/lightnvr /var/lib/lightnvr /var/log/lightnvr /var/run/lightnvr /var/lib/lightnvr/recordings
86+ RUN mkdir -p /etc/lightnvr /var/lib/lightnvr /var/log/lightnvr /var/run/lightnvr /var/lib/lightnvr/recordings && \
87+ chmod -R 777 /var/lib/lightnvr /var/log/lightnvr /var/run/lightnvr
7788
7889# Copy MbedTLS libraries from builder
7990COPY --from=builder /usr/local/lib/libmbed*.so* /usr/local/lib/
0 commit comments