Skip to content

Improve docker ignorefile honoring #808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 3, 2024
Merged

Improve docker ignorefile honoring #808

merged 4 commits into from
Aug 3, 2024

Conversation

agcty
Copy link
Contributor

@agcty agcty commented Jul 30, 2024

.dockerignore files are only honored at project root, this PR changes the name to Dockerfile.dockerignore which makes docker actually honor the given patterns no matter on which path the ignorefile lives.

Src: https://stackoverflow.com/questions/71359019/where-to-place-dockerignore-for-docker-build-f-path-to-docker-dockerfile

Right now if you run the following command:

docker build -t epic-stack:latest -f other/Dockerfile .

the patterns in .dockerignore are in fact not ignored.

In addition, fly allows you to configure the docker and ignorefile in the build section of the configuration which means you don't need to move the files to the root anymore for the honoring of the ignore patterns happening.

Overall, this PR removes unneeded code and workarounds that are better solved with the correct configuration.

@agcty agcty changed the title remove moving dockerfile in ci, improve local docker dx Improve docker ignorefile honoring Jul 30, 2024
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm much happier with this. Thank you!

@kentcdodds kentcdodds merged commit 06f908b into epicweb-dev:main Aug 3, 2024
5 checks passed
kgoggin added a commit to kgoggin/epic-stack that referenced this pull request Aug 21, 2024
kentcdodds pushed a commit that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants