Skip to content

Fix Dockerfile.gpu: COPY sources before install_deps.sh - #272

Open
haas-ac wants to merge 1 commit into
OpenDroneMap:masterfrom
idt-fhac:fix/dockerfile-gpu-copy-order
Open

Fix Dockerfile.gpu: COPY sources before install_deps.sh#272
haas-ac wants to merge 1 commit into
OpenDroneMap:masterfrom
idt-fhac:fix/dockerfile-gpu-copy-order

Conversation

@haas-ac

@haas-ac haas-ac commented Aug 18, 2026

Copy link
Copy Markdown

Problem

Dockerfile.gpu currently runs install_deps.sh and ln -s /var/www/node.sh before COPY. Both files live in this repository, so a GPU image build from source fails (install_deps.sh: No such file or directory).

A later RUN npm install --production also fails (npm: not found) because Node/npm come from nvm inside install_deps.sh and are not on PATH in a new layer.

The CPU Dockerfile already does this correctly: COPY first, then install_deps.sh and node --powercycle in the same RUN.

Change

  • Copy the tree into /var/www before installing deps
  • Keep install_deps.sh, tool symlinks, and node index.js --powercycle in one RUN (install_deps.sh already runs npm install --production)
  • Keep the CUDA ldconfig step and the odm user
  • Add ARG FROM_REPO=opendronemap/odm:gpu so a custom ODM GPU image can be used with --build-arg FROM_REPO=…

Test

PR CI only builds the CPU Dockerfile, not Dockerfile.gpu.

Built locally with a custom ODM GPU base:

bash
docker build -f Dockerfile.gpu \
  --build-arg FROM_REPO=<odm-gpu-image> \
  -t nodeodm:gpu-test .
docker run --rm --gpus all -p 3000:3000 nodeodm:gpu-test
curl -s http://127.0.0.1:3000/info

Container starts and /info responds.

Notes

This is a small bugfix (NodeODM README: PR directly). I used an AI coding assistant to help draft the reorder; the failure mode and the intended order come from GPU builds against current master.

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.

@maurerle maurerle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This harmonizes the dockerfile.gpu with the other Dockerfile and reduces the unique changes 😊

Comment thread Dockerfile.gpu
@@ -1,31 +1,32 @@
FROM opendronemap/odm:gpu
ARG FROM_REPO=opendronemap/odm:gpu
FROM ${FROM_REPO}

@maurerle maurerle Aug 19, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful when cross checking other states of the underlying ODM image.
Similar as here: https://github.com/WebODM/NodeODX/blob/a480583ff8a4d7aaa23f890433b78727ebe750d0/Dockerfile.gpu#L1-L2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants