-
Notifications
You must be signed in to change notification settings - Fork 644
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
Fix Buildx build with Dockerfile outside of Docker build context #1721
Conversation
@mruzicka : Thanks for your pr, Is it possible to write some test to validate this fix? |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1721 +/- ##
============================================
+ Coverage 65.11% 65.23% +0.11%
- Complexity 2254 2274 +20
============================================
Files 172 172
Lines 10111 10173 +62
Branches 1391 1403 +12
============================================
+ Hits 6584 6636 +52
- Misses 2977 2984 +7
- Partials 550 553 +3
|
@rohanKanojia, I've added an integration test here: https://github.com/fabric8io/docker-maven-plugin/tree/dd73682de2b296d2ca56c1a395e4c0f67d39b15d/it/buildx-dockerfile_and_contextdir |
f9588d3
to
dd73682
Compare
Thanks! Test looks good, and the fix as well. Could you please add an entry to https://github.com/fabric8io/docker-maven-plugin/blob/master/doc/changelog.md for the fix, too ? I think we are good to merge then. |
+ Fixes a Buildx build failure when an external Dockerfile outside of the build context directory is specified. The Dockerfile (be it an external one or the generated one) is always stored at the root of the build archive created by: DockerAssemblyManager.createDockerTarArchive() Bear that in mind when creating the full path of the Dockerfile to pass to Buildx. Signed-off-by: Michal Růžička <[email protected]>
Hi, @rhuss, I've added the changelog entry. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs 100.0% Coverage The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
@mruzicka : Thanks a lot! |
Thank you! |
Fixes a Buildx build failure when an external Dockerfile outside of the Docker build context directory is specified.
The Dockerfile (be it an external one or the generated one) is always stored at the root of the build archive created by
DockerAssemblyManager.createDockerTarArchive()
.Before this patch the code which constructs the full path of the Dockerfile to pass to Buildx didn't take that into account.