Add VS Code Dev Container Configuration - #19597
Conversation
Add a complete devcontainer environment for building and testing darktable, including Dockerfile with all dependencies, configuration, and documentation. Also update .gitignore to exclude AppDir for AppImage builds.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a complete VS Code Dev Container configuration for darktable development, enabling contributors to start building immediately without manual environment setup. The configuration provides a fully-equipped Ubuntu 24.04-based container with all build dependencies, optimized VS Code settings, and comprehensive documentation.
Key Changes:
- Added containerized development environment with pre-installed build dependencies and tools
- Configured VS Code with C/C++ development extensions and appropriate settings
- Provided complete documentation covering build workflows, AppImage creation, and troubleshooting
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .devcontainer/devcontainer.json | Configures the dev container with build context, VS Code extensions, and automatic git submodule initialization |
| .devcontainer/Dockerfile | Defines Ubuntu 24.04 base image with all required and optional darktable build dependencies |
| .devcontainer/README.md | Provides comprehensive documentation for building, testing, and troubleshooting in the dev container |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Sounds like a nice contribution. I'm not expert on this and so I'd like another dev using VS Code (yeah I'm an Emacs user) to test. |
|
I have some thoughts and questions EDIT: I removed my questions about AI generated code because I realized, too late, that it wasn't well worded and conveyed the wrong message. I'll address it in a issue and hopefully state it better that I did here.
How long does it take to compile darktable in a container? On a windows VM with 4 cores it takes 30+ minutes for a full build.
The developers are currently on a lot of different systems using the tools they've come to know and love (even Emacs 😛 ). The varied environments allow bugs that only show up on one or two environments to be caught quickly. Building in a walled garden only ensures that you can build in a walled garden.
Currently the appimage is built from code tested on a variety of systems and we still run into bugs that are appimage specific. So, this may help drive out some of those bugs. However, appimage is another "walled garden" and doesn't guarantee that code that runs in the appimage is bug free when compiled and run on different operating systems/versions. I'm guessing that VS Code will do incremental compiling. I've been bitten many times by incremental compiles that work but fail when built from the top. Just a caution. Overall I think this could be a good thing and maybe bring some more developers into the mix, with the hope that we can finally get some windows developers. But, as I'm looking up at the CI runs I notice that it takes 5 or 6 minutes on Linux/MacOS and it's over an hour on Windows and still going |
|
@wpferguson Thank you for the detailed feedback! Let me address each point: AI-Generated CodeI want to be transparent: I used AI assistance (GitHub Copilot) during development, but with careful human oversight. The workflow was:
This wasn't a one-shot AI generation - it involved significant trial, error, and manual refinement. The AI helped me navigate the codebase faster as a new contributor, but all decisions and validation were human-driven. I'm happy to add a note in the PR if you have guidelines for AI-assisted contributions. Build Time in ContainerOn my machine (ThinkPad T14 Gen 1, AMD Ryzen 5 Pro 4650U, 40 GB RAM, SSD):
This is with all CPU cores available to Docker. Performance will vary based on:
Incremental builds are significantly faster, as VS Code/CMake Tools handle this well. "Walled Garden" Concerns - Valid Point!I completely agree that diverse development environments catch more bugs. This devcontainer is not intended to replace existing development workflows. It's an additional option for:
This is a supplementary tool, not a replacement for native builds on varied systems. Scope and LimitationsThe devcontainer is intentionally limited:
Windows developers would still need native Windows builds - this devcontainer doesn't help with Windows-specific development. Incremental Build ConcernsGood point! The documentation should emphasize clean builds when testing. I can add a note about this in the README. Editor SupportWhile this is VS Code-focused, devcontainers are actually editor-agnostic:
The CI Windows Build TimeRegarding the Windows CI taking over an hour: I believe this is unrelated to this PR. The only file modified outside The devcontainer files ( Suggestion: Re-trigger the Windows CI job to see if it's a transient issue. SummaryThis devcontainer is:
It's meant to lower the barrier to entry while preserving the value of testing on varied real-world systems. Existing developers can continue using their preferred native setups. Happy to make adjustments based on project preferences! Let me know if you'd like any changes to scope or documentation. |
|
This pull request has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please verify it has no conflicts with the master branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work. |
|
This pull request has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please verify it has no conflicts with the master branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work. |
Co-authored-by: Philipp Lutz <810285+da-phil@users.noreply.github.com>
|
This pull request has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please verify it has no conflicts with the master branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work. |
|
This pull request has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please verify it has no conflicts with the master branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work. |
|
Is running darktable in a container really feasible/advisable for users based on darktable's resource requirements (memory, hardware acceleration, etc)? Do we want to support another platform? If someone downstream wants to provide darktable as a container and support it, then that's fine. I'm not sure that we want to take that on, especially if the user experience isn't good. |
Yes, that would work too, but I wouldn't bother about using such a docker image as a run-time environment, we have our AppImages for such a use-case. This would also solve the dependency duplication across our CI pipelines:
It's easy that drift can happen between those files, build guidelines and README files which talk about build-time dependencies across all supported operating systems. |
Until CI running on a dockerfile has a problem that can't be reproduced outside of the dockerfile. |
What are your concerns concretely? |
|
Current master is almost unusable for any serious work. The UI sometimes (rarely) displays the correct cursor that corresponds with the operation you are performing. Randomly when switching to the next image in darkroom view the image switches, loads the new image, then jumps back to the previous image and resets it. If you return to lighttable the next image is the one that shows selected, not the current image which is the one that got reset. It's so bad that I've written tools to clean up the aftermath quickly so that I can get some work done. All the UI problems above are code that was written by AI, compiles fine, passes CI and doesn't work because it wasn't thoroughly tested by the developer. So now it's up to the devs to TEST the code, write up the problems, and then retest the possibly tested fixes. In the meantime, the stuff we were working on sits by the wayside. I don't know how much a dockerfile version of darktable is capable of but I suspect it is far less than darktable running natively, so testing by the dev will necessarily be limited and incomplete leading to more situations as I described above. CI only tests that darktable will compile and run, and the IOP modules produce a given result for a given input. It doesn't test to make sure darktable actually works. |
|
@wpferguson all what you wrote above is not wrong, I would agree with most of it,but it is a tangent to the discussion about how helpful a reference build environment for reproducible builds is. I think we all acknowledge the power of diversity of native build environments to catch issues on all possible Linux distros with different library versions, this is not going away once we have such a reference build environment. Turns out in #21911 that @TurboGit faced an issue with his native build environment, if we already had this docker container with the reference build environment in place, he could just easily pick up work and not wait until his local build environment gets fixed. Another reason for having such a reference build environment. |
|
Btw. @kadykov I'm sorry that I haven't resolved the previous review comments, github simply does not let me do it... |
|
Two notable changes: Tiers merged into two options. The three-tier structure (Docker CLI / devcontainer CLI / IDE) was replaced by two options: Docker CLI and Dev Container. The old Tier 2 and Tier 3 were the same underlying thing — both use
The image won't exist in GHCR until this PR merges. Once it does, the first build-docker.yml run will publish it (the Dockerfile being added to master counts as a change to the |
|
The CI dependencies were updated when my PR (#21420) got merged, I think you need to update the docker image. |
da-phil
left a comment
There was a problem hiding this comment.
Look good for me now, thank you for the work!
|
@da-phil Thank you for reviewing this pull request and for your great suggestions. Also, I would like to thank everybody who contributed to the discussion of this pull request. I agree with @da-phil that this pull request is complete now and could be merged. We can continue work and discussion on the CI refactoring on the follow-up pull request. |
TurboGit
left a comment
There was a problem hiding this comment.
Thanks, I'll see if I find time to experiment with this at some point.
* build(devcontainer): add development container setup Add a complete devcontainer environment for building and testing darktable, including Dockerfile with all dependencies, configuration, and documentation. Also update .gitignore to exclude AppDir for AppImage builds. * Remove apt cache in the container Co-authored-by: Philipp Lutz <810285+da-phil@users.noreply.github.com> * Add devcontainer-lock.json for common-utils feature configuration * Add additional dependencies for image processing and tools in Dockerfile * Align development container with CI environment by updating base image to Ubuntu 26.04 and installing matching packages. Enhance README with compiler details and CI alignment information. * Update README to clarify devcontainer purpose and prerequisites, enhancing compatibility details for various IDEs. * Remove clang-format extension from VSCode settings in devcontainer configuration * Rewrite dev container README, reference container-based build environment for contributors in the main README * Enhance README with Docker and Podman installation instructions for container-based build environment * Add GitHub Actions workflow to build and publish Docker image * Update README to merge tier 2 and 3, add dev container installation instructions and GHCR images use * Update Dockerfile to speed up installation with eatmydata and add missing dependencies * Add packages for AppImage building and OpenCL support in Dockerfile --------- Co-authored-by: Philipp Lutz <810285+da-phil@users.noreply.github.com>
* build(devcontainer): add development container setup Add a complete devcontainer environment for building and testing darktable, including Dockerfile with all dependencies, configuration, and documentation. Also update .gitignore to exclude AppDir for AppImage builds. * Remove apt cache in the container Co-authored-by: Philipp Lutz <810285+da-phil@users.noreply.github.com> * Add devcontainer-lock.json for common-utils feature configuration * Add additional dependencies for image processing and tools in Dockerfile * Align development container with CI environment by updating base image to Ubuntu 26.04 and installing matching packages. Enhance README with compiler details and CI alignment information. * Update README to clarify devcontainer purpose and prerequisites, enhancing compatibility details for various IDEs. * Remove clang-format extension from VSCode settings in devcontainer configuration * Rewrite dev container README, reference container-based build environment for contributors in the main README * Enhance README with Docker and Podman installation instructions for container-based build environment * Add GitHub Actions workflow to build and publish Docker image * Update README to merge tier 2 and 3, add dev container installation instructions and GHCR images use * Update Dockerfile to speed up installation with eatmydata and add missing dependencies * Add packages for AppImage building and OpenCL support in Dockerfile --------- Co-authored-by: Philipp Lutz <810285+da-phil@users.noreply.github.com>

Summary
This PR adds a complete VS Code Dev Container configuration for darktable development, making it easy for contributors to get started with a fully configured build environment.
What's Included
Dev Container Setup
Features
Developer Benefits
Usage
./build.sh --prefix /tmp/dt --build-type RelWithDebInfoScope
This devcontainer is focused on:
It does NOT include:
Testing
I have verified that this configuration successfully:
libcmocka-devinstallation)Documentation
Complete documentation is provided in
.devcontainer/README.mdcovering:Files Changed
Notes
vscode(UID 1000) for proper file permissionspostCreateCommandbuild/directoryThis configuration should make it significantly easier for new contributors to start working on darktable without spending time on environment setup.