Skip to content

[WIP] Multi-stage build for Dockerfile.dependencies_humble#3900

Draft
karttikjangid wants to merge 4 commits into
JdeRobot:humble-develfrom
karttikjangid:multistage-deps-humble
Draft

[WIP] Multi-stage build for Dockerfile.dependencies_humble#3900
karttikjangid wants to merge 4 commits into
JdeRobot:humble-develfrom
karttikjangid:multistage-deps-humble

Conversation

@karttikjangid

Copy link
Copy Markdown
Contributor

This is a full multi-stage rewrite of Dockerfile.dependencies_humble, not
a small tweak — the diff goes from 373 to 635 lines. Opening as Draft
since to showcase the changes i will make in it in upcoming days .

What changed

Split into two stages:

  • deps-builder: unchanged from the original file — same commands, same
    order, compiles everything (ROS workspaces, gz_ros2_control, aerostack2).
  • deps-final: new. Reinstalls only the packages actually needed, copies
    the compiled workspace output wholesale (no subsetting), keeps the full
    ROS build toolchain.

Why the toolchain stays

Dockerfile.humble compiles CustomRobots/jderobot_drones/Industrial/
common_interfaces_cpp directly on top of this image via its own colcon
build call. A pure-runtime deps-final would break that build. Confirmed
via Slack

What got trimmed

  • tmux/tmuxinator — confirmed zero invocations via a full boot/launch
    call-graph trace (dead code, not just unused-by-assumption).
  • postgresql-18 -> libpq5 — confirmed the DB server binary is never
    started in this image, only the client library psycopg2 links against.

Verified

  • Full ldd sweep, zero unresolved libraries, across both workspaces.
  • Django/DB/RAM-websocket/noVNC endpoint tests via docker compose, all
    passing.
  • Image size: 11.9GB -> 10.7GB, measured same-day against a freshly
    rebuilt copy of the original file (not an old/stale number).

Out of scope for this PR

  • Dockerfile.humble's own multi-stage split — planned as a follow-up
    once this is merged or another approach would be to change both of them test them completely giving some more time and then merge both pr's.
  • An unrelated issue found while testing exercise loading through
    docker compose (two database init SQL files had been emptied locally,
    unrelated to this Dockerfile) — already fixed locally, root cause
    still being looked into separately, not caused by and not blocking
    this PR.

Question before this is ready for full review

Does the toolchain-kept approach match what you had in mind here?

@karttikjangid

Copy link
Copy Markdown
Contributor Author
image Follow line exercise is working . @javizqh can you also please do your testing and tell me if you find any problem i am also doing testing only

@karttikjangid

Copy link
Copy Markdown
Contributor Author

In the visual object detection it is showing up that the connecting to Robotics Backend for 10-15 mins without any error in logs , can you check from your side ?

- ARG NVIDIA_VISIBLE_DEVICES → ENV so the value persists into runtime
- Remove no-op RUN source in Dockerfile.humble (subshell, no effect)
Splits into deps-builder (compiles everything, unchanged from original)
and deps-final (runtime + toolchain retained, since Dockerfile.humble
compiles directly on top of this image). No changes to colcon
invocations or --symlink-install.

Verified: full ldd sweep across both workspaces, endpoint/DB/websocket
tests via docker compose, image size 11.9GB -> 10.7GB measured same-day
against a fresh rebuild of the original file.
@karttikjangid karttikjangid force-pushed the multistage-deps-humble branch from 2f9b204 to 5ff934d Compare July 9, 2026 06:52
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.

1 participant