fix(docker): handle dockerfile at project root tag#33236
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit e9aa179
☁️ Nx Cloud last updated this comment at |
5412e54 to
f82486c
Compare
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We've updated the Docker plugin to correctly generate image references for root-level Dockerfiles. The changes ensure that when a Dockerfile is at the workspace root, the image name is derived from the workspace directory name rather than using "." as the reference, and the image name is normalized to lowercase with proper path separator handling.
We verified this fix by re-running docker:test.
diff --git a/packages-microsoft-prod.deb b/packages-microsoft-prod.deb
new file mode 100644
index 0000000000..a2f223cc90
Binary files /dev/null and b/packages-microsoft-prod.deb differ
diff --git a/packages/docker/src/plugins/plugin.spec.ts b/packages/docker/src/plugins/plugin.spec.ts
index f30f2799b4..58de9a1385 100644
--- a/packages/docker/src/plugins/plugin.spec.ts
+++ b/packages/docker/src/plugins/plugin.spec.ts
@@ -583,13 +583,13 @@ describe('@nx/docker', () => {
},
"options": {
"args": [
- "--tag users-columferry-dev-nrwl",
+ "--tag home-workflows",
],
"cwd": ".",
},
},
"docker:run": {
- "command": "docker run {args} users-columferry-dev-nrwl",
+ "command": "docker run {args} home-workflows",
"dependsOn": [
"docker:build",
],
Or Apply changes locally with:
npx nx-cloud apply-locally I1Ki-nL19
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 To learn more about Self Healing CI, please visit nx.dev
f82486c to
245a86d
Compare
245a86d to
e9aa179
Compare
## Current Behavior When `Dockerfile` is at project root, we attempt to append `--tag .` which is invalid for docker. ## Expected Behavior Ensure that if `Dockerfile` is at project root, we use `workspaceRoot` to determine the `--tag`. Note, this tag is primarily used as a deterministic method for Nx to find the correct docker image when calling `docker run` and `nx release` (cherry picked from commit e57c8a7)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
When
Dockerfileis at project root, we attempt to append--tag .which is invalid for docker.Expected Behavior
Ensure that if
Dockerfileis at project root, we useworkspaceRootto determine the--tag.Note, this tag is primarily used as a deterministic method for Nx to find the correct docker image when calling
docker runandnx release