Skip to content
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

respect settings in .dockerignore #362

Closed
computerlyrik opened this issue Jan 10, 2016 · 6 comments
Closed

respect settings in .dockerignore #362

computerlyrik opened this issue Jan 10, 2016 · 6 comments
Assignees
Milestone

Comments

@computerlyrik
Copy link
Contributor

I have a Dockerfile inside my project root.

The assembly within the maven plugin is configured

                                <assembly>
                            <dockerFileDir>${project.basedir}</dockerFileDir>
                                </assembly>

How do i prevent the system from including the ./target folder recursively on building?

A .dockerignore file like

target/

Does not help.

rhuss added a commit that referenced this issue Jan 20, 2016
When doing builds with `dockerFileDir` set then a .maven-dockerignore can be given which includes FileSet exclude patterns (ant style globs). These are ignored when doing the build.
It is intentionally not called `.dockerignore` in order to avoid confusion with Docker's .dockerignore which uses a different syntax.
@rhuss
Copy link
Collaborator

rhuss commented Jan 20, 2016

You are right, .dockerignore is a feature of the docker CLI command (which is not used by this plugin).

I just added support for a .maven-dockerignore file which can hold Ant style patterns for excluding files.

For advanced cases a %regex[...] as described here should do it, too. But that's neither tested nor documented ;-)

'hope that fits your use case.

@rhuss rhuss added this to the 0.13.8 milestone Jan 20, 2016
@rhuss rhuss self-assigned this Jan 20, 2016
@rhuss
Copy link
Collaborator

rhuss commented Jan 21, 2016

0.13.8 released

@rhuss rhuss closed this as completed Jan 21, 2016
@StevesRoger
Copy link

Where should i put .maven-dockerignore?

@mteodori
Copy link

mteodori commented Mar 9, 2021

why not just using the standard .dockerignore and invent another file doing the same?

@rhuss
Copy link
Collaborator

rhuss commented Mar 9, 2021

Because it uses different syntax and has different caps.

image

@mteodori
Copy link

mteodori commented Mar 9, 2021

Thank you for the clear explanation, I would have preferred maven configuration properties in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants