From f058f3c1c39722e0fda590b373681c330e6df7f7 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Tue, 18 Aug 2026 14:57:55 +0200 Subject: [PATCH] Fix GPU Dockerfile: COPY sources before install_deps.sh install_deps.sh and node.sh are in the NodeODM tree, so they must be copied before the RUN that invokes them. npm also comes from nvm, so node --powercycle has to stay in the same RUN as install_deps.sh. --- Dockerfile.gpu | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Dockerfile.gpu b/Dockerfile.gpu index 434b4cb1..ee6e07a4 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -1,31 +1,32 @@ -FROM opendronemap/odm:gpu +ARG FROM_REPO=opendronemap/odm:gpu +FROM ${FROM_REPO} MAINTAINER Piero Toffanin EXPOSE 3000 USER root +RUN mkdir /var/www + +WORKDIR "/var/www" +COPY . /var/www + ENV NVM_DIR /usr/local/nvm ENV NODE_VERSION 14 +# install_deps.sh needs the tree (COPY above) and nvm's node/npm in the same RUN. RUN bash install_deps.sh && \ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \ ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine && \ ln -s /code/SuperBuild/install/bin/pdal /usr/bin/pdal && \ - ln -s /var/www/node.sh /usr/bin/node + ln -s /var/www/node.sh /usr/bin/node && \ + mkdir -p tmp && node index.js --powercycle RUN echo /usr/local/cuda-11.2/compat >> /etc/ld.so.conf.d/989_cuda-11.conf && ldconfig -RUN mkdir /var/www - -WORKDIR "/var/www" -RUN useradd -m -d "/home/odm" -s /bin/bash odm -COPY --chown=odm:odm . /var/www - -RUN npm install --production && mkdir -p tmp && node index.js --powercycle - -RUN chown -R odm:odm /var/www -RUN chown -R odm:odm /code +RUN useradd -m -d "/home/odm" -s /bin/bash odm && \ + chown -R odm:odm /var/www && \ + chown -R odm:odm /code USER odm