Skip to content

build(devcontainer): switch to .docker images and Linux-only devcontainer#3114

Merged
CharlVS merged 7 commits intodevfrom
build/devcontainer-reuse-docker-images
Sep 1, 2025
Merged

build(devcontainer): switch to .docker images and Linux-only devcontainer#3114
CharlVS merged 7 commits intodevfrom
build/devcontainer-reuse-docker-images

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Aug 29, 2025

Summary

  • Reuse .docker Dockerfiles for devcontainer
  • Linux-only container; restored USB mount
  • Prebuild base image in initializeCommand
  • Delete obsolete .devcontainer/Dockerfile

Notes

  • macOS: not supported inside container; use Linux host or WSL2
  • WSL2: supported; use ADB over Wi‑Fi for device debugging

Validation

  • Built container on Linux; static analysis unchanged

Summary by CodeRabbit

  • Chores
    • Streamlined Dev Container setup by switching to a prebuilt Android SDK image and adding an initialization step.
    • Added a post-create script to auto-initialize submodules and adjust permissions.
    • Enforced dependency consistency by running Flutter install with lockfile enforcement on attach.
    • Removed the legacy Dev Container Dockerfile.
    • Broadened ignoring of build directories across the repository.
    • Reduced status noise by configuring the SDK submodule to ignore local changes.

Use komodo/komodo-wallet image; prebuild base images in initializeCommand; remove USB mount; macOS/WSL compatible. Delete obsolete .devcontainer/Dockerfile.
Build from .docker Dockerfile with USB mount; add GH workflow to build images on hosted runners.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 29, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Removes the local devcontainer Dockerfile, updates devcontainer.json to use a centralized Dockerfile and adds an initialize build step. Introduces a postCreate.sh to handle ownership and submodule setup. Tightens flutter pub get with lockfile enforcement. Adjusts .gitignore to match any build directory and configures sdk submodule to ignore dirty state.

Changes

Cohort / File(s) Summary of edits
Devcontainer rework
.devcontainer/devcontainer.json, .devcontainer/postCreate.sh, .devcontainer/Dockerfile
Switch devcontainer to use ../.docker/komodo-wallet-android.dockerfile, add initializeCommand to build Android SDK image, replace post-create with .devcontainer/postCreate.sh, enforce lockfile on attach; add new postCreate script; remove legacy Dockerfile.
Submodule handling
.gitmodules, .devcontainer/postCreate.sh
Set ignore = dirty for sdk submodule; post-create script syncs/updates submodules and configures submodule behaviors.
Git ignore pattern
.gitignore
Change ignore from /build/ to **/build/ to match build directories anywhere.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as VS Code Dev Container
  participant DK as Docker
  participant IMG as Base Image (.docker/*)
  participant C as Container
  participant SH as .devcontainer/postCreate.sh
  participant G as Git/Submodules
  participant F as Flutter

  Dev->>DK: docker build (initializeCommand)
  DK->>IMG: Build komodo/android-sdk:35
  DK-->>Dev: Image ready

  Dev->>DK: Create & start container
  DK-->>C: Container running

  Dev->>C: Run postCreateCommand
  C->>SH: Execute script
  SH->>C: chown (best-effort)
  SH->>G: submodule sync / update (recursive, checkout)

  Dev->>C: postAttachCommand
  C->>F: flutter pub get --enforce-lockfile
  F-->>C: Dependencies resolved
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

In a burrow of bytes I hop with cheer,
The old crate’s gone—new docks appear!
I nibble locks so deps don’t drift,
Submodules tidy, a neat little gift.
Build paths vanish like carrot trails—
Ship ahop! Our dev-container sails. 🥕🐇

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch build/devcontainer-reuse-docker-images

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 29, 2025

Visit the preview URL for this PR (updated for commit d13f6a1):

https://walletrc--pull-3114-merge-fd4mbmwx.web.app

(expires Sun, 07 Sep 2025 23:17:57 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

@CharlVS CharlVS requested a review from takenagain August 29, 2025 17:04
@CharlVS CharlVS marked this pull request as draft August 29, 2025 17:04
cursor[bot]

This comment was marked as outdated.

@CharlVS CharlVS marked this pull request as ready for review August 29, 2025 17:21
@CharlVS CharlVS requested a review from gcharang August 29, 2025 17:21
@CharlVS CharlVS self-assigned this Aug 29, 2025
@CharlVS CharlVS requested a review from Copilot August 29, 2025 17:31
@CharlVS
Copy link
Copy Markdown
Collaborator Author

CharlVS commented Aug 29, 2025

@coderabbitai review please

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 29, 2025

@CharlVS I'll review the changes in this PR for you.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the devcontainer configuration to reuse existing Dockerfiles from the .docker directory instead of maintaining a separate devcontainer-specific Dockerfile. The changes shift to a Linux-only container with improved build optimization and submodule handling.

  • Switches from custom devcontainer Dockerfile to reusing .docker/komodo-wallet-android.dockerfile
  • Adds prebuild optimization with initializeCommand for base image creation
  • Implements enhanced post-creation setup with submodule initialization and permission handling

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
.gitmodules Adds ignore = dirty setting for submodule handling
.devcontainer/postCreate.sh New script for workspace permissions and submodule initialization
.devcontainer/devcontainer.json Updates to use .docker Dockerfiles and new lifecycle commands
.devcontainer/Dockerfile Removes obsolete 117-line custom Dockerfile

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
.devcontainer/devcontainer.json (1)

8-8: Quote the command string for bash -lc.

Prevents parsing surprises; mirrors prior feedback.

-"postCreateCommand": "bash -lc .devcontainer/postCreate.sh",
+"postCreateCommand": "bash -lc '.devcontainer/postCreate.sh'",
🧹 Nitpick comments (2)
.devcontainer/postCreate.sh (1)

13-14: Set submodule config locally; avoid duplicating repo-wide setting.

Since .gitmodules already sets ignore = dirty (or if removed per suggestion), keep these as local overrides without || true so misconfigurations surface.

-git config fetch.recurseSubmodules on-demand || true
-git config submodule.sdk.ignore dirty || true
+git config fetch.recurseSubmodules on-demand
+git config submodule.sdk.ignore dirty
.devcontainer/devcontainer.json (1)

7-7: Initialize step: consider pulling latest base and enabling BuildKit cache.

This makes the base image deterministic and fresher.

-"initializeCommand": "docker build -t komodo/android-sdk:35 -f ${localWorkspaceFolder}/.docker/android-sdk.dockerfile ${localWorkspaceFolder}",
+"initializeCommand": "DOCKER_BUILDKIT=1 docker build --pull -t komodo/android-sdk:35 -f ${localWorkspaceFolder}/.docker/android-sdk.dockerfile ${localWorkspaceFolder}",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b65f54b and b7675e0.

📒 Files selected for processing (5)
  • .devcontainer/Dockerfile (0 hunks)
  • .devcontainer/devcontainer.json (1 hunks)
  • .devcontainer/postCreate.sh (1 hunks)
  • .gitignore (1 hunks)
  • .gitmodules (1 hunks)
💤 Files with no reviewable changes (1)
  • .devcontainer/Dockerfile
🔇 Additional comments (6)
.gitignore (1)

36-36: No tracked files under any build/ directories—ignore pattern is safe. A repository-wide search confirmed zero tracked files in build/ paths, so the broadened **/build/ ignore won’t hide existing artifacts.

.devcontainer/postCreate.sh (2)

3-3: Good: strict shell flags.


1-19: No action required: postCreate.sh is already executable (mode 100755).

.devcontainer/devcontainer.json (3)

4-4: Dockerfile path change looks good; confirms reuse of central .docker image.


9-9: No action needed: pubspec.lock is present at the workspace root, so using flutter pub get --enforce-lockfile will not produce false failures.


5-5: Verified ‘komodo’ user exists
The android-sdk Dockerfile (.docker/android-sdk.dockerfile) creates the komodo user (via useradd … komodo) and sets USER $USER, so remoteUser: "komodo" is valid.

@cursor
Copy link
Copy Markdown

cursor bot commented Aug 31, 2025

Bugbot found 1 bug

To see it, activate your membership in the Cursor dashboard.

Copy link
Copy Markdown
Contributor

@takenagain takenagain left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Worked locally and in Codespaces in my testing (using flutter run -d web-server --web-port=8081), although the debugging experience was not as smooth as local builds.

I resolved some review comments in d13f6a1 alongside disabling the "--privileged" flag by default, as it would only be necessary for USB debugging (which is untested and might require steps to get working)

@CharlVS CharlVS merged commit bbef719 into dev Sep 1, 2025
10 of 14 checks passed
@CharlVS CharlVS deleted the build/devcontainer-reuse-docker-images branch September 1, 2025 10:44
@coderabbitai coderabbitai bot mentioned this pull request Oct 2, 2025
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.

4 participants