# How to make cloud to pick up my Dockerfile?

**URL:** <https://forum.cursor.com/t/how-to-make-cloud-to-pick-up-my-dockerfile/163136>\
**Category:** Help\
**Tags:** cloud-agents\
**Created:** [June 12, 2026, 7:00pm UTC](https://forum.cursor.com/t/how-to-make-cloud-to-pick-up-my-dockerfile/163136 "2026-06-12T19:00:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmytro\_Afonin](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@Dmytro\_Afonin](https://forum.cursor.com/u/Dmytro_Afonin)\
**Post date:** [June 12, 2026, 7:00pm UTC](https://forum.cursor.com/t/how-to-make-cloud-to-pick-up-my-dockerfile/163136/1 "2026-06-12T19:00:07Z")

</div>

### 

I pushed an environment.json

```auto

{
 "build": {
 "dockerfile": "Dockerfile",
 "context": ".."
},
"install": "bash .cursor/cloud-agent-install.sh",
"start": "bash .cursor/cloud-agent-start.sh",
"terminals": [
 {
  "name": "Convex",
  "command": "pnpm exec convex dev"
 },
 {
  "name": "App",
  "command": "pnpm dev",
  "ports": [
    3000
   ]
  }
 ]
}

```

cloud detects environment. but I only have 1 button - start agent setup. And when I click it - the agent is able to set up the env, but it does not do anything with Docker at all. I want to use node24 image, but agent detects it is 22 and then goes circles installing v24 via nvm instead of using the Docker image. How it should work? I dont understand how to use docker setup at all. Please help

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [June 15, 2026, 7:05am UTC](https://forum.cursor.com/t/how-to-make-cloud-to-pick-up-my-dockerfile/163136/5 "2026-06-15T07:05:31Z")

</div>

Hey, thanks for the request. Two different environment setup modes got mixed up here, and that’s why it’s confusing.

There are two mutually exclusive options:

1. Interactive snapshot  
This is the Set up agent or Start agent setup button. Cursor starts a base Ubuntu image with Node 22, then the agent installs dependencies interactively, which is why it uses nvm to get to 24. After that it offers to save a snapshot. This mode completely ignores `build.dockerfile`, so it looks like nothing happens with Docker.

2. Dockerfile mode  
For this one, you don’t need to click Set up agent. Just commit `.cursor/environment.json` with your `build` block plus `.cursor/Dockerfile`, then start a normal cloud agent on this repo and branch. The image will be built from the Dockerfile automatically.

What to double check in your config:

- File location. Paths in `build` are resolved relative to `.cursor`. So `"dockerfile": "Dockerfile"` means `.cursor/Dockerfile`, the file must physically be there. `"context": ".."` points to the repo root, that’s fine.
- Your Dockerfile must install `git` and ideally `sudo`. Cloud Agent runs `git clone` inside the container, and a custom image without git fails with a clone error. Add something like `RUN apt-get update && apt-get install -y git sudo`.
- Don’t `COPY` the project into the image. Cursor will fetch the right commit itself.
- If you previously saved a snapshot for this repo in Dashboard \> Environments, it overrides the Dockerfile and keeps restoring. Delete the saved environment to force a fresh Dockerfile build.

More details on both modes: [Cloud Environment Setup | Cursor Docs](https://cursor.com/docs/cloud-agent/setup)

Let me know how it goes after deleting the snapshot and confirming git is installed in the image.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [July 15, 2026, 7:05am UTC](https://forum.cursor.com/t/how-to-make-cloud-to-pick-up-my-dockerfile/163136/6 "2026-07-15T07:05:53Z")

</div>

Closed on July 15, 2026, 7:05am UTC

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