dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
309 stars 36 forks source link

Ignore .git directory when determining if context has changed #180

Closed tduffield closed 4 years ago

tduffield commented 4 years ago

There are other directories in the root of a project that we'd want to ignore other than .dobi. Eventually it might make sense to make this configurable via a meta parameter.

Closes #179.

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.

dnephin commented 4 years ago

Thank you for the PR!

I'm not sure if adding .git is technically safe. If someone is building an image that includes .git this will incorrectly prevent the image from re-building.

I thought there was somewhere that dobi read the .dockerignore file and used that list of excludes, but I'm not seeing it now. I will need to have another look. I think using a file like .dockerignore to exclude it might be the right approach.

tduffield commented 4 years ago

Okay, let me see if that works.

tduffield commented 4 years ago

So the .dockerignore file is read in as part of the buildImage function in build.go, after we have determined whether or not the image is stale. It might be possible to read in the contents of .dockerignore earlier to identify what should be ignored in determining staleness. Is that safer?

tduffield commented 4 years ago

Closing in favor of #181