Skip to content

fix(docker): symlink gitnexus binary onto $PATH in runtime image (#1549)#1551

Merged
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
Avicennasis:fix/dockerfile-symlink-gitnexus-binary
May 13, 2026
Merged

fix(docker): symlink gitnexus binary onto $PATH in runtime image (#1549)#1551
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
Avicennasis:fix/dockerfile-symlink-gitnexus-binary

Conversation

@Avicennasis

Copy link
Copy Markdown
Contributor

Summary

Fixes one of the two bugs reported in #1549: the documented Docker workflow command

docker compose exec gitnexus-server gitnexus index /workspace/my-repo

currently fails with exec: "gitnexus": executable file not found in $PATH. This PR adds a single symlink in the runtime stage of Dockerfile.cli so the command works as written.

Mechanism

gitnexus/package.json declares "bin": { "gitnexus": "dist/cli/index.js" }. In a normal npm install that exposes node_modules/.bin/gitnexus and (if installed globally) /usr/local/bin/gitnexus. But the builder stage runs npm prune --omit=dev --prefix gitnexus (Dockerfile.cli line 37), which strips node_modules/.bin/ entries, and nothing in the runtime stage re-adds the gitnexus name to $PATH. The container's own CMD works because the Dockerfile invokes Node directly:

CMD ["node", "gitnexus/dist/cli/index.js", "serve", ...]

…but anyone following the README has no way to know that without reading the Dockerfile.

dist/cli/index.js already carries #!/usr/bin/env node and 755 perms, so a single symlink into /usr/local/bin is the minimal fix.

Test plan

docker build -f Dockerfile.cli -t gitnexus:local-pr-test .

# Symlink + version (was: "executable file not found in $PATH")
docker run --rm gitnexus:local-pr-test which gitnexus
# → /usr/local/bin/gitnexus
docker run --rm gitnexus:local-pr-test gitnexus --version
# → 1.6.4
docker run --rm gitnexus:local-pr-test gitnexus --help | head -2
# → Usage: gitnexus [options] [command]

# CMD path unchanged
docker run --rm -d --name t gitnexus:local-pr-test
sleep 4
docker exec t curl -s localhost:4747/api/health
# → {"status":"ok"}

Both verified locally.

Notes

Refs #1549.

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.
@vercel

vercel Bot commented May 13, 2026

Copy link
Copy Markdown

@Avicennasis is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
8844 8843 0 1 416s

✅ All 8843 tests passed

1 test(s) skipped — expand for details
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 77.66% 27140/34947 N/A% 🟢 ███████████████░░░░░
Branches 66.09% 17114/25894 N/A% 🟢 █████████████░░░░░░░
Functions 82.37% 2735/3320 N/A% 🟢 ████████████████░░░░
Lines 80.82% 24529/30347 N/A% 🟢 ████████████████░░░░

📋 View full run · Generated by CI

@magyargergo magyargergo merged commit 507f84b into abhigyanpatwari:main May 13, 2026
36 of 37 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants