Skip to content

fix(docker): handle dockerfile at project root tag#33236

Merged
Coly010 merged 1 commit intomasterfrom
docker/handle-root-dockefile-tag
Oct 24, 2025
Merged

fix(docker): handle dockerfile at project root tag#33236
Coly010 merged 1 commit intomasterfrom
docker/handle-root-dockefile-tag

Conversation

@Coly010
Copy link
Copy Markdown
Contributor

@Coly010 Coly010 commented Oct 24, 2025

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

@Coly010 Coly010 requested a review from a team as a code owner October 24, 2025 12:09
@Coly010 Coly010 self-assigned this Oct 24, 2025
@Coly010 Coly010 requested a review from leosvelperez October 24, 2025 12:09
@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Oct 24, 2025 4:50pm

@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 24, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit e9aa179
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/68fba41c67975900076479e2
😎 Deploy Preview https://deploy-preview-33236--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Oct 24, 2025

View your CI Pipeline Execution ↗ for commit e9aa179

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 22m 44s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 49s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 10s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-24 16:33:45 UTC

Comment thread packages/docker/src/plugins/plugin.ts Outdated
nx-cloud[bot]

This comment was marked as outdated.

@Coly010 Coly010 force-pushed the docker/handle-root-dockefile-tag branch 2 times, most recently from 5412e54 to f82486c Compare October 24, 2025 13:25
nx-cloud[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

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",
                     ],

Apply fix via Nx Cloud  Reject fix via Nx Cloud

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

@Coly010 Coly010 force-pushed the docker/handle-root-dockefile-tag branch from f82486c to 245a86d Compare October 24, 2025 15:50
@Coly010 Coly010 requested a review from jaysoo as a code owner October 24, 2025 15:50
Comment thread packages/docker/src/plugins/plugin.ts
@Coly010 Coly010 force-pushed the docker/handle-root-dockefile-tag branch from 245a86d to e9aa179 Compare October 24, 2025 16:06
@Coly010 Coly010 merged commit e57c8a7 into master Oct 24, 2025
18 of 19 checks passed
@Coly010 Coly010 deleted the docker/handle-root-dockefile-tag branch October 24, 2025 16:36
FrozenPandaz pushed a commit that referenced this pull request Oct 27, 2025
## 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)
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants