# Custom Docker Builds

When you need full control over the build environment — a specific base image, complex system dependencies, or custom steps that [Salus buildpacks](https://salus.cloud/docs/pipelines/builds/buildpacks/) can’t express — build your project from your own **Dockerfile** instead.

1.  In **Build Configurations**, enable **Custom Docker builds**.
2.  Set the **Dockerfile path**, relative to the project root (for example `Dockerfile` or `docker/Dockerfile`). A leading slash is optional — Salus trims it. The path can’t contain commas or trailing spaces.

Salus then builds your image straight from that Dockerfile, giving you complete control over how the app is compiled and packaged.

The **build context is the repository root**, even when the project builds from a subfolder. In a repository with several apps, write `COPY` paths from the root: `COPY api/requirements.txt .`, not `COPY requirements.txt .`.

Heads up

Docker builds trade speed for flexibility — they generally take longer than a buildpack build.

## Troubleshooting

-   **Docker build can’t find the Dockerfile.** Confirm the **Dockerfile path** is relative to the project root and free of commas and trailing spaces.
-   **`COPY` fails with a file not found.** The build context is the repository root, so paths in the Dockerfile start from there, not from the project’s subfolder.
