feat(docker): default dev container to Ubuntu 24.04#9714
Draft
JArmandoAnaya wants to merge 1 commit intocarla-simulator:ue5-devfrom
Draft
feat(docker): default dev container to Ubuntu 24.04#9714JArmandoAnaya wants to merge 1 commit intocarla-simulator:ue5-devfrom
JArmandoAnaya wants to merge 1 commit intocarla-simulator:ue5-devfrom
Conversation
…table The Util/Docker dev environment isolates the CARLA UE5 toolchain (CMake, ninja, clang, Python, libtiff, libpng, glibc shims, UE5 prerequisites) from whatever the host happens to have installed. That isolation gives contributors three things that matter in practice: 1. Host independence: building CARLA does not require uninstalling or shadowing the system Python, system CMake, or other versions a host distro and other projects already rely on. 2. Reproducibility: a build or test failure inside the image reproduces bit-for-bit on a different machine by rebuilding the same image, instead of turning into a per-host investigation of CMake versions and LD_LIBRARY_PATH state. 3. Stable compilation across many computers: the recipe travels unchanged across Ubuntu 22.04, Ubuntu 24.04, Fedora, Pop_OS, etc., which keeps "works on my machine" from becoming a per-developer scavenger hunt. PR carla-simulator#9596 added host-side Ubuntu 24.04 build support (the __isoc23_strtol glibc shim, the libtiff5-dev to libtiff-dev swap, and the PEP 668 pip handling) but deferred the Docker side. This PR closes the developer-facing half of that gap so a contributor on a 24.04 host no longer gets a 22.04 image whose Base.Dockerfile fails on a missing libtiff5-dev package. Layout * The two Dockerfiles that the helper scripts actually invoke are reorganised into a per-distro layout: Util/Docker/22.04 and Util/Docker/24.04, each holding a linear, conditional-free Base.Dockerfile and Development.Dockerfile. Util/Docker/build.sh resolves --ubuntu-distro to the matching subdirectory and refuses values with no directory; Util/Docker/run.sh defaults to the ue5-24.04 image and container names. * Util/Docker/Release.Dockerfile has no caller anywhere in the repo (build.sh, run.sh, .github/workflows, Util/Tools/Deploy.{sh,bat}, the CMake graph) and is left untouched. Cleaning up that orphan is out of scope for this PR. * build.sh passes --build-context carla-root=<repo root> so each Dockerfile reads requirements.txt and PythonAPI/{examples,util}/ requirements.txt directly via COPY --from=carla-root, replacing the previous .tmp staging copy. 24.04 image * Base.Dockerfile installs libtiff-dev (the noble package name), upgrades pip with --ignore-installed (the dpkg-managed pip on noble has no RECORD file so a normal self-upgrade fails), and compiles Python 3.10.14 from source via Util/Docker/24.04/build_scripts/ build_cpython.sh so the Python API can target either 3.10 or 3.12 via -DPython_ROOT_DIR. CMake comes from apt and resolves to 3.28.3, which clears CARLA's current 3.27.2 minimum. * Development.Dockerfile reuses an existing group when the host docker GID collides with systemd-journal at GID 999 inside the noble base image, instead of failing groupadd. 22.04 image * Base.Dockerfile keeps its previous shape minus the upstream CMake tarball download. apt cmake on jammy is 3.22.1, below the project minimum, so users opting back into 22.04 must upgrade CMake themselves; the Dockerfile keeps a single apt install cmake line and the 22.04 path becomes best-effort. Docs and CHANGELOG * Docs/build_devcontainer.md documents the new default, adds a "Build for a different Ubuntu version" subsection, and updates every docker exec example plus the devcontainer.json snippet. * Docs/build_linux_ue5.md no longer says "Ubuntu 22.04 at minimum", it lists 22.04 and 24.04 as supported and points at the Docker fallback for any other host. * CHANGELOG.md gains one user-facing bullet. Out of scope CI workflow changes are intentionally not included. PR carla-simulator#9601 owns the _ci-ubuntu.yml matrix and is blocked on the carlasim/carla-builder image being available, which this PR produces locally so the same recipe can be published. Validated on Ubuntu 24.04 (RTX 50, driver 590.48): carla-base and carla-development images build clean, libcarla_test_server 44/44 and libcarla_test_client 58/58 pass, cmake --build Build --target package succeeds with both Python 3.10 and Python 3.12 wheels. Related: carla-simulator#9596 (host-side 24.04, merged), carla-simulator#9597 (umbrella issue, "24.04 CI image" checkbox), carla-simulator#9601 (CI matrix, open).
Contributor
There was a problem hiding this comment.
Pull request overview
Updates CARLA’s Docker-based UE5 development environment to default to Ubuntu 24.04 while keeping Ubuntu 22.04 selectable via --ubuntu-distro, aligning the container workflow with the project’s host-side 24.04 support.
Changes:
- Split Dockerfiles into per-distro directories (
Util/Docker/22.04/andUtil/Docker/24.04/) and default scripts to 24.04. - Reworked
build.shto use a named build context (carla-root) instead of staging requirements into.tmp/. - Updated docs and changelog to reflect the new default and distro selection.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Util/Docker/run.sh | Default --ubuntu-distro to 24.04 and update help text. |
| Util/Docker/build.sh | Default to 24.04, select per-distro Dockerfiles, and use named build context for requirements. |
| Util/Docker/24.04/Base.Dockerfile | Add new 24.04 base image with apt CMake, pip behavior for PEP 668, and CPython 3.10 build. |
| Util/Docker/24.04/Development.Dockerfile | Add new 24.04 dev image with UID/GID mapping and docker GID collision guard. |
| Util/Docker/24.04/build_scripts/build_cpython.sh | New helper to build/install CPython 3.10 via altinstall. |
| Util/Docker/22.04/Base.Dockerfile | Move 22.04 base to per-distro directory; switch to libtiff-dev; stop bundling newer CMake. |
| Util/Docker/22.04/Development.Dockerfile | Move 22.04 dev Dockerfile; switch requirements to named context copies. |
| Docs/build_linux_ue5.md | Update supported Ubuntu versions and recommend Docker for version validation. |
| Docs/build_devcontainer.md | Update devcontainer docs for 24.04 default and 22.04 opt-in. |
| CHANGELOG.md | Add user-facing entry describing new default and Python 3.10-in-24.04 image behavior. |
Comments suppressed due to low confidence (1)
Docs/build_devcontainer.md:8
- The build scripts now rely on BuildKit named build contexts (
--build-context/COPY --from=carla-root). It would help to mention this in prerequisites (e.g., “Docker with BuildKit enabled / sufficiently recent Docker Engine”) so contributors on older Docker installs can self-diagnose build failures quickly.
CARLA UE5 can be built inside a Docker container running Ubuntu 24.04 (default) or Ubuntu 22.04. This is useful when your host OS does not meet UE5's compilation requirements, or when you want to validate the build on a specific Ubuntu version without changing your host. The container provides the correct toolchain and dependencies while you keep all source code on the host.
## Prerequisites
- [Docker](https://docs.docker.com/engine/install/) installed and configured for non-root use
- [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) for GPU support
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Default the
Util/Docker/dev environment to Ubuntu 24.04 and keep 22.04 selectable via--ubuntu-distro 22.04. PR #9596 added host-side 24.04 support but deferred the Docker dev image, which was still pinned to 22.04 and hardcodedlibtiff5-dev(a package that does not exist on noble).The Docker workflow exists so contributors do not have to install CARLA's toolchain on their host: it isolates CMake, Python, libtiff, ninja, and UE5 prerequisites inside the image, makes build failures reproducible across machines, and keeps "works on my machine" from becoming a per-developer scavenger hunt. Aligning the default with the same Ubuntu the project targets on bare metal preserves that isolation.
Changes
Util/Docker/22.04/{Base,Development}.DockerfileandUtil/Docker/24.04/{Base,Development}.Dockerfile, each linear and conditional-free.Util/Docker/Release.Dockerfilehas no caller anywhere in the repo and is left untouched.build.shresolves--ubuntu-distroto the matching subdirectory and passes--build-context carla-root=<repo root>so each Dockerfile readsrequirements.txtandPythonAPI/{examples,util}/requirements.txtdirectly viaCOPY --from=carla-root. The previous.tmp/staging copy is gone.build.shandrun.shis now24.04.apt install cmake(3.28.3, clears the project's 3.27.2 minimum),libtiff-dev(the noble name), pip self-upgrade with--ignore-installed, Python 3.10.14 compiled from source viabuild_scripts/build_cpython.sh(so the Python API can target 3.10 or 3.12 via-DPython_ROOT_DIR), and a GID-collision guard for the docker group (noble'ssystemd-journalclaims GID 999).apt cmakeon jammy is 3.22.1, below the project minimum, so the 22.04 path is best-effort and users opting back must upgrade CMake themselves.Docs/build_devcontainer.mdandDocs/build_linux_ue5.mdupdated.CHANGELOG.mdgets one user-facing bullet.CI workflow changes are out of scope; PR #9601 owns
_ci-ubuntu.ymland is unblocked by this PR producing the image locally.Where has this been tested?
Possible Drawbacks
carla-development:ue5-22.04images and volumes are unaffected; switching to the new default is opt-out via--ubuntu-distro 22.04.libtiff-devon 22.04 is a transitional package; if a future point release drops it, the Dockerfile will need a one-line conditional likeInstallPrerequisites.sh.cmake 3.22.1in apt (below the 3.27.2 minimum); users on the 22.04 image must upgrade CMake themselves.carlasim/carla-builder:ue5-24.04is not yet on Docker Hub; CI consumers (PR feat: add Ubuntu 24.04 CI matrix entry #9601) need the published tag.Related: #9596 (host-side 24.04, merged), #9597 (umbrella issue), #9601 (CI matrix).
This change is