fix(docker): symlink gitnexus binary onto $PATH in runtime image (#1549)#1551
Merged
magyargergo merged 1 commit intoMay 13, 2026
Conversation
The README documents the Docker workflow as:
WORKSPACE_DIR=$HOME/code docker compose up -d
docker compose exec gitnexus-server gitnexus index /workspace/my-repo
…but `gitnexus` is not on $PATH inside the published image:
$ docker compose exec gitnexus-server which gitnexus
(empty)
$ docker compose exec gitnexus-server gitnexus --version
exec: "gitnexus": executable file not found in $PATH
The package.json `bin` entry (`"gitnexus": "dist/cli/index.js"`) would
normally surface via `node_modules/.bin/gitnexus`, but `npm prune
--omit=dev` in the builder stage strips that directory before the runtime
stage copies it in. The `dist/cli/index.js` itself already has the
`#!/usr/bin/env node` shebang and 755 permissions, so a single symlink
into /usr/local/bin makes the README's literal command work.
Verified locally:
$ docker build -f Dockerfile.cli -t gitnexus:local-pr-test .
$ docker run --rm gitnexus:local-pr-test gitnexus --version
1.6.4
$ docker run --rm gitnexus:local-pr-test gitnexus --help
Usage: gitnexus [options] [command]
…
$ docker run --rm -d --name t gitnexus:local-pr-test \
&& sleep 4 && docker exec t curl -s localhost:4747/api/health
{"status":"ok"}
CMD continues to invoke `node gitnexus/dist/cli/index.js serve …`
unchanged, so the change is additive and the server boot path is
untouched.
Refs #1549.
|
@Avicennasis is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 8843 tests passed 1 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
dp-web4
pushed a commit
to dp-web4/GitNexus
that referenced
this pull request
May 13, 2026
…igyanpatwari#1551) The README documents the Docker workflow as: WORKSPACE_DIR=$HOME/code docker compose up -d docker compose exec gitnexus-server gitnexus index /workspace/my-repo …but `gitnexus` is not on $PATH inside the published image: $ docker compose exec gitnexus-server which gitnexus (empty) $ docker compose exec gitnexus-server gitnexus --version exec: "gitnexus": executable file not found in $PATH The package.json `bin` entry (`"gitnexus": "dist/cli/index.js"`) would normally surface via `node_modules/.bin/gitnexus`, but `npm prune --omit=dev` in the builder stage strips that directory before the runtime stage copies it in. The `dist/cli/index.js` itself already has the `#!/usr/bin/env node` shebang and 755 permissions, so a single symlink into /usr/local/bin makes the README's literal command work. Verified locally: $ docker build -f Dockerfile.cli -t gitnexus:local-pr-test . $ docker run --rm gitnexus:local-pr-test gitnexus --version 1.6.4 $ docker run --rm gitnexus:local-pr-test gitnexus --help Usage: gitnexus [options] [command] … $ docker run --rm -d --name t gitnexus:local-pr-test \ && sleep 4 && docker exec t curl -s localhost:4747/api/health {"status":"ok"} CMD continues to invoke `node gitnexus/dist/cli/index.js serve …` unchanged, so the change is additive and the server boot path is untouched. Refs abhigyanpatwari#1549.
hohaivu
pushed a commit
to hohaivu/GitNexus
that referenced
this pull request
May 19, 2026
…igyanpatwari#1551) The README documents the Docker workflow as: WORKSPACE_DIR=$HOME/code docker compose up -d docker compose exec gitnexus-server gitnexus index /workspace/my-repo …but `gitnexus` is not on $PATH inside the published image: $ docker compose exec gitnexus-server which gitnexus (empty) $ docker compose exec gitnexus-server gitnexus --version exec: "gitnexus": executable file not found in $PATH The package.json `bin` entry (`"gitnexus": "dist/cli/index.js"`) would normally surface via `node_modules/.bin/gitnexus`, but `npm prune --omit=dev` in the builder stage strips that directory before the runtime stage copies it in. The `dist/cli/index.js` itself already has the `#!/usr/bin/env node` shebang and 755 permissions, so a single symlink into /usr/local/bin makes the README's literal command work. Verified locally: $ docker build -f Dockerfile.cli -t gitnexus:local-pr-test . $ docker run --rm gitnexus:local-pr-test gitnexus --version 1.6.4 $ docker run --rm gitnexus:local-pr-test gitnexus --help Usage: gitnexus [options] [command] … $ docker run --rm -d --name t gitnexus:local-pr-test \ && sleep 4 && docker exec t curl -s localhost:4747/api/health {"status":"ok"} CMD continues to invoke `node gitnexus/dist/cli/index.js serve …` unchanged, so the change is additive and the server boot path is untouched. Refs abhigyanpatwari#1549.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes one of the two bugs reported in #1549: the documented Docker workflow command
currently fails with
exec: "gitnexus": executable file not found in $PATH. This PR adds a single symlink in the runtime stage ofDockerfile.cliso the command works as written.Mechanism
gitnexus/package.jsondeclares"bin": { "gitnexus": "dist/cli/index.js" }. In a normalnpm installthat exposesnode_modules/.bin/gitnexusand (if installed globally)/usr/local/bin/gitnexus. But the builder stage runsnpm prune --omit=dev --prefix gitnexus(Dockerfile.cli line 37), which stripsnode_modules/.bin/entries, and nothing in the runtime stage re-adds thegitnexusname to$PATH. The container's ownCMDworks because the Dockerfile invokes Node directly:…but anyone following the README has no way to know that without reading the Dockerfile.
dist/cli/index.jsalready carries#!/usr/bin/env nodeand 755 perms, so a single symlink into/usr/local/binis the minimal fix.Test plan
Both verified locally.
Notes
CMD ["node", "gitnexus/...", "serve", ...]boot path. Only adds a name on$PATH.ensureGitNexusIgnored(#1549) #1550 fixes the second bug from Documented Docker workflow (gitnexus index /workspace/<repo>on:romount) is broken in two places #1549 (ensureGitNexusIgnoredfailing on the documented:roworkspace mount). Together they make the README's literaldocker compose exec gitnexus-server gitnexus index /workspace/my-repocommand work end-to-end.Refs #1549.