Skip to content

[BUG] Dev container build fails - Dockerfile is designed for production, not development #10788

@RaviTejaNalluri

Description

@RaviTejaNalluri

Bug Description

The dev container configuration in .devcontainer/devcontainer.json references the production Dockerfile, which attempts to compile the entire Hyperswitch codebase during container build. This makes the dev container unusable as the build either times out, runs out of memory, or takes an extremely long time (20-40+ minutes).

Expected Behavior

The dev container should build quickly (1-3 minutes) and provide a ready-to-use Rust development environment where developers can then compile the code themselves.

Actual Behavior

The container build attempts to run cargo build --release during the Docker image build phase, which:
Takes 20-40+ minutes
Requires 8-16GB+ RAM (often exceeding Docker's default memory limits)
Downloads all crate dependencies during build
Fails on most developer machines due to resource constraints

Steps To Reproduce

1.Clone the repository
2. Open in VS Code or Cursor
3. When prompted "This workspace contains a devcontainer.json file. Would you like to reopen it in a container?", click "Reopen in Container"

Build fails with error: An error occurred building the image.
2025-12-24 10:43:00.880 [info] [devcontainer run-user-commands][exit]: {"status":1} 2025-12-24 10:43:00.882 [error] Error resolving dev container authority Failed to run devcontainer command: 1. {"outcome":"error","message":"Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/yf/4t5n49y111b09pnw4068p4x80000gn/T/devcontainercli/container-features/0.80.2-1766590791620/Dockerfile-with-features -t vsc-hyperswitch-d116de1a977ce1d956178d54591c2a55bcf07c75d539915672a67567262803b1 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/yf/4t5n49y111b09pnw4068p4x80000gn/T/devcontainercli/container-features/0.80.2-1766590791620 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=app:app --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp ,"description":"An error occurred building the image."}

Context For The Bug

How has this issue affected you?

I wanted to use the dev container feature to quickly set up a consistent development environment without manually installing Rust, protobuf, libpq, and other dependencies on my local machine. When I clicked "Reopen in Container" in my IDE (Cursor/VS Code), the container build failed after several minutes with the error "An error occurred building the image."

What are you trying to accomplish?

I'm trying to set up a local development environment for Hyperswitch using dev containers. The dev container feature is meant to provide a quick, reproducible development setup - ideally building in 1-3 minutes - so developers can start coding immediately. Instead, the current configuration attempts a full production release build during container creation, which defeats the purpose of dev containers and makes the feature unusable.
The expected workflow should be:

Clone repo → 2. Open in IDE → 3. Click "Reopen in Container" → 4. Start developing

But currently step 3 fails, blocking new contributors from using this streamlined setup path.

Environment

Are you using hyperswitch hosted version? No

If not (or if building/running locally), please provide the following details:
Operating System or Linux distribution: macOS (Darwin 23.6.0)
Rust version (output of rustc --version): rustc 1.86.0 (05f9846f8 2025-03-31)
App version (output of cargo r --features vergen -- --version): N/A - This issue occurs during dev container setup before any local build can happen. The dev container fails to build, preventing any compilation of the application.

Have you spent some time checking if this bug has been raised before?

  • I checked and didn't find a similar issue

Have you read the Contributing Guidelines?

Are you willing to submit a PR?

Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: BugS-awaiting-triageStatus: New issues that have not been assessed yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions