Cloud Agents not working with Dockerfile-based environment.json

Where does the bug appear (feature/product)?

Background Agent (GitHub, Slack, Web, Linear)

Describe the Bug

Cloud Agent sessions fail with an unexpected error message when configured with a Dockerfile-based environment.json. For this repo, I’m building a simple ubuntu:24.04 image with Node 24.13.0 installed on it. The Cloud Agent builds the docker image successfully, but fails with the unexpected error after the “Cloning Repository…” step.

Steps to Reproduce

Run a Cloud Agent with the following .cursor/environment.json and Dockerfile:

// .cursor/environment.json

{
  "build": {
    "dockerfile": "../.devcontainer/Dockerfile",
    "context": ".."
  },
  "install": "npm install"
}


// .devcontainer/Dockerfile

FROM ubuntu:24.04

ARG NODE_VERSION=24.13.0

# Install base tooling from Ubuntu mirrors (allowlisted in Cursor Cloud defaults).
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  ca-certificates curl xz-utils \
  && apt-get clean && rm -rf /var/lib/apt/lists/*

# Install Node.js directly from nodejs.org to avoid registry/mirror drift.
RUN set -eux; \
  arch="$(dpkg --print-architecture)"; \
  case "$arch" in \
    amd64) node_arch="x64" ;; \
    arm64) node_arch="arm64" ;; \
    *) echo "Unsupported architecture: $arch" && exit 1 ;; \
  esac; \
  curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz; \
  tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \
  rm -f /tmp/node.tar.xz; \
  node --version; \
  npm --version

# Playwright (Chromium) system deps for e2e.
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  libnspr4 libnss3 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2t64 \
  libxkbcommon0 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 \
  libxrandr2 libgbm1 libasound2t64 \
  && apt-get clean && rm -rf /var/lib/apt/lists/*

Expected Behavior

The Cloud Agent should start up without errors

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Cloud Agent

For AI issues: add Request ID with privacy disabled

bc-f463927e-8d13-463b-8557-c85ee162c07e

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report. The issue is that your Dockerfile doesn’t include git - Cloud Agents run git clone inside your custom container, so git needs to be available in the image.

Add git (and sudo is also recommended) to your apt-get install line:

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  ca-certificates curl xz-utils git sudo \
  && apt-get clean && rm -rf /var/lib/apt/lists/*

The error message you’re seeing (“unexpected error”) is definitely not helpful here - we’re aware this needs to be improved.

This requirement isn’t currently documented, which is on us. A working Dockerfile reference with git included can be found in this thread.

Let me know if it works after the change.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.