Skip to content

Unify duplicate Dockerfiles using build arguments#102

Merged
Haydnspass merged 5 commits intomainfrom
copilot/deprecate-duplicate-dockerfiles
Jan 24, 2026
Merged

Unify duplicate Dockerfiles using build arguments#102
Haydnspass merged 5 commits intomainfrom
copilot/deprecate-duplicate-dockerfiles

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Eliminates duplication between cuda-12.4.1-ubuntu-22.04.Dockerfile and cuda-13.1.0-ubuntu-24.04.Dockerfile by consolidating into a single parameterized Dockerfile.

Changes

  • New unified Dockerfile (.docker/Dockerfile) with build arguments:

    • UBUNTU_VERSION: 22.04 | 24.04 (default: 24.04)
    • CUDA_VERSION: 12.4.1 | 13.1.0 (default: 13.1.0)
    • ROS_DISTRO: humble | jazzy (default: jazzy)
  • Conditional logic for Ubuntu version differences:

    • Ubuntu user creation (22.04 only - user pre-exists in 24.04 base images)
    • python3-setuptools package (22.04 only)
  • Updated references:

    • GitHub workflow now uses matrix strategy to test both configurations:
      • Ubuntu 22.04 + CUDA 12.4.1 + ROS humble
      • Ubuntu 24.04 + CUDA 13.1.0 + ROS jazzy
    • README.md with examples for both configurations
  • Removed duplicate Dockerfiles

Usage

# Ubuntu 24.04 (default)
docker build -f .docker/Dockerfile -t roboreg:latest .

# Ubuntu 22.04
docker build -f .docker/Dockerfile \
  --build-arg UBUNTU_VERSION=22.04 \
  --build-arg CUDA_VERSION=12.4.1 \
  --build-arg ROS_DISTRO=humble \
  -t roboreg:22.04 .
Original prompt

This section details on the original issue you should resolve

<issue_title>Deprecate duplicated .Dockerfile and harmnonize into one</issue_title>
<issue_description>As an AI engineer I want to avoid code duplication for brevity and maintainability.
Currently, we have two .Dockerfiles with almost the same content.
Therefore, harmonize them into one by using Docker build args: https://docs.docker.com/build/building/variables/#arg-usage-example</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 24, 2026 09:00
Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com>
Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com>
Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com>
Copilot AI changed the title [WIP] Harmonize duplicate .Dockerfiles into one Unify duplicate Dockerfiles using build arguments Jan 24, 2026
Copilot AI requested a review from Haydnspass January 24, 2026 09:05
Copy link
Collaborator

@Haydnspass Haydnspass left a comment

Choose a reason for hiding this comment

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

Great. Almost done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

use a matrix and test both scenarios for which we had dedicated dockerfiles before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added matrix strategy to test both Ubuntu 22.04 (CUDA 12.4.1, ROS humble) and Ubuntu 24.04 (CUDA 13.1.0, ROS jazzy) configurations in commit 7501f75.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, love :)

Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com>
Copilot AI requested a review from Haydnspass January 24, 2026 09:16
@Haydnspass Haydnspass marked this pull request as ready for review January 24, 2026 09:24
@Haydnspass Haydnspass requested a review from mhubii January 24, 2026 09:25
Copy link
Contributor

@mhubii mhubii left a comment

Choose a reason for hiding this comment

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

LGTM

@Haydnspass Haydnspass merged commit 3330220 into main Jan 24, 2026
7 of 11 checks passed
@Haydnspass Haydnspass deleted the copilot/deprecate-duplicate-dockerfiles branch January 24, 2026 09:39
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.

Deprecate duplicated .Dockerfile and harmnonize into one

3 participants