# Why .dockerignore at the project root?

**URL:** <https://forums.balena.io/t/why-dockerignore-at-the-project-root/369858>\
**Category:** Product support\
**Tags:** docker\
**Created:** [February 2, 2024, 9:37pm UTC](https://forums.balena.io/t/why-dockerignore-at-the-project-root/369858 "2024-02-02T21:37:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cvdactyl](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/cvdactyl/32/9634_2.png) [@cvdactyl](https://forums.balena.io/u/cvdactyl)\
**Post date:** [February 2, 2024, 9:37pm UTC](https://forums.balena.io/t/why-dockerignore-at-the-project-root/369858/1 "2024-02-02T21:37:16Z")

</div>

I have a microservices project with two containers. The basic file layout is like this:

```auto
.
├── backend
│ ├── .dockerignore
│ ├── Dockerfile
│ └── app.py
├── docker-compose.yml
└── frontend
    ├── App.js
    └── Dockerfile

```

When I run `balena push` it complains:

```auto
[Warn] The following .dockerignore file(s) will not be used:
[Warn] * /home/ubuntu/notification-server/backend/.dockerignore
[Warn] By default, only one .dockerignore file at the source folder (project
[Warn] root) is used. Microservices (multicontainer) fleets may use a separate
[Warn] .dockerignore file for each service with the --multi-dockerignore (-m)
[Warn] option. See "balena help push" for more details.

```

I don’t understand this. I thought that each service would be built independently, and thus each should be able to have its own `.dockerignore`. Furthermore AFAIK the docker build process will actively refuse to consider anything outside of the root directory it’s building from - the so-called “context”. For security reasons, and layer caching reasons - it CAN NOT consider any files outside of the context.

So, why is the balena builder telling me to merge all the `dockerignore`s from all my containers into one overarching one?
