# Circleci build tool should respect .dockerignore file

**URL:** <https://discuss.circleci.com/t/circleci-build-tool-should-respect-dockerignore-file/21283>\
**Category:** Product Feedback\
**Created:** [April 5, 2018, 3:39pm UTC](https://discuss.circleci.com/t/circleci-build-tool-should-respect-dockerignore-file/21283 "2018-04-05T15:39:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ego](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ego/32/31011_2.png) [@ego](https://discuss.circleci.com/u/ego)\
**Post date:** [April 5, 2018, 3:39pm UTC](https://discuss.circleci.com/t/circleci-build-tool-should-respect-dockerignore-file/21283/1 "2018-04-05T15:39:04Z")

</div>

This is related to an issue reported earlier by other users and ignored and closed:  
[https://discuss.circleci.com/t/circleci-build-on-macos-is-unusably-slow/14653?u=ego](https://discuss.circleci.com/t/circleci-build-on-macos-is-unusably-slow/14653)

The problem is when you have a large amount of files in the local project dir. These all have to be sent to the docker daemon as ‘build context’, this can take a long time (especially under hyperkit, but also under virtualbox)

Docker has a solution for this in the form of a .dockerignore file, containing paths to exclude from sending to the daemon.

> **[Dockerfile reference](https://docs.docker.com/engine/reference/builder/#dockerignore-file)**
>
> Dockerfiles use a simple DSL which allows you to automate the steps you would normally manually take to create an image.

But the circleci build tool does not seem to make use of the .dockerignore file. I created one but it made no difference. However deleting the unwanted dirs (in my case they were build artefacts so I could just delete them) made it work… no more hanging on the ‘checkout’ step.

So I suggest that the tool should be made to take advantage of .dockerignore file when present.

It would also help if there was some indication of what the tool is actually doing in this phase. Currently it just says:

```auto
====>> Checkout code
  #!/bin/sh
mkdir -p /home/circleci/project && cp -r /tmp/_circleci_local_build_repo/. /home/circleci/project

```

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [April 10, 2018, 12:33am UTC](https://discuss.circleci.com/t/circleci-build-tool-should-respect-dockerignore-file/21283/2 "2018-04-10T00:33:20Z")

</div>

Hey,

This feels more like a feature request instead of a bug report.

I’m going to remove this from the `bug report` category. I’d suggest submitting this as a Feature Request to [circleci.com/ideas](http://circleci.com/ideas).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [July 9, 2018, 12:33am UTC](https://discuss.circleci.com/t/circleci-build-tool-should-respect-dockerignore-file/21283/3 "2018-07-09T00:33:33Z")

</div>

Closed on July 9, 2018, 12:33am UTC

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