# Docker Compose files including build steps fail

### Issue

In Portainer versions 2.29.2 and greater, deploying a stack that includes a build directive to a remote Docker environment fails with the error:

`Unable to upgrade to tcp, received 200`

This limitation is under review internally, for now external builds are the most stable option.

#### Workaround

Currently Portainer does not support executing build steps inside a compose file for remote environments.

To deploy successfully:

1. Build the image outside Portainer using Docker or a CI pipeline
2. Push the image to a registry or load it onto the remote host
3. Update your compose file to reference the built image, removing any build directives


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.portainer.io/2.33-lts/faqs/known-issues/docker-compose-files-including-build-steps-fail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
