# \`balena build\` a single image from a compose project?

**URL:** <https://forums.balena.io/t/balena-build-a-single-image-from-a-compose-project/369470>\
**Category:** Product support\
**Created:** [December 5, 2023, 3:35pm UTC](https://forums.balena.io/t/balena-build-a-single-image-from-a-compose-project/369470 "2023-12-05T15:35:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrr](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jrr/32/9321_2.png) [@jrr](https://forums.balena.io/u/jrr)\
**Post date:** [December 5, 2023, 3:35pm UTC](https://forums.balena.io/t/balena-build-a-single-image-from-a-compose-project/369470/1 "2023-12-05T15:35:44Z")

</div>

I have a multicontainer project and run `balena build` in CI. Rather than building the whole docker-compose, I have CI build each container individually, so that I can specify architecture. (this is a compromise for performance: some use amd64, some use emulated arm)

My preference would be to use a command analogous to `docker-compose build foo`, which looks up `foo` in the docker-compose.yml file and builds it.

I don’t see anything like this available from `balena build`, so instead I reference the context directory and Dockerfile:

```auto
balena build -d amd64 -A amd64 --noparent-check --dockerfile Dockerfile.template project-directory

```

This works for services that have their own directories.

One of the services, though, lives at the root, sharing a directory with docker-compose.yml. This is necessary because the project needs the larger build context.

I try to build it individually like this:

```auto
balena build -d amd64 -A amd64 --noparent-check --dockerfile Dockerfile.foo.template .

```

But `balena build` ignores my request and builds the whole project:

```auto
[Warn] Ignoring alternative dockerfile "Dockerfile.foo.template" because composition file "docker-compose.yml" exists

```

Is there a way to avoid this behavior?
