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

Allow user to specify which .dockerignore to use for image building #1356

Open
ansonlc opened this issue Mar 22, 2021 · 2 comments
Open

Allow user to specify which .dockerignore to use for image building #1356

ansonlc opened this issue Mar 22, 2021 · 2 comments
Labels
area/building-images Issues related to building Docker images kind/feature New feature or feature request

Comments

@ansonlc
Copy link

ansonlc commented Mar 22, 2021

Is your feature request related to a problem?
our production image doesn’t include our tests in the image, but we want them in the dev image to reduce the size of the initial sync.

Which solution do you suggest?
allow users to specify which .dockerignore to use for image building

Which alternative solutions exist?
define a hook that calls a devspace custom command which could do something like this:
mv .dockerignore ./devspace/.dockerignore
cp .dockerignore_dev .dockerignore
This hook could be triggered before image building and then a second hook could do this:
mv -f ./devspace/.dockerignore .dockerignore
And this second hook would run after image building

/kind feature

@FabianKramm FabianKramm added area/building-images Issues related to building Docker images kind/feature New feature or feature request labels Mar 23, 2021
@FabianKramm
Copy link
Collaborator

@ansonlc thanks for creating this issue! I see, since docker buildkit has a similar feature where a .dockerignore can be specified as <dockerfile-name>.dockerignore, we thought we could implement a feature were devspace would prefer devspace.dockerignore over a regular .dockerignore. This would not require a new config option and should solve your issue. What do you think about this?

@ansonlc
Copy link
Author

ansonlc commented Mar 23, 2021

@ansonlc thanks for creating this issue! I see, since docker buildkit has a similar feature where a .dockerignore can be specified as <dockerfile-name>.dockerignore, we thought we could implement a feature were devspace would prefer devspace.dockerignore over a regular .dockerignore. This would not require a new config option and should solve your issue. What do you think about this?
@FabianKramm that would be great! thanks for getting back to me so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/building-images Issues related to building Docker images kind/feature New feature or feature request
Projects
None yet
Development

No branches or pull requests

3 participants