`arch` doesn't work on distroless images (since there is no shell)
- Dominant language
- JavaScript
- Stars
- 81
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Trying to run software ([`serve`](https://www.npmjs.com/package/serve)) that transitively requires `arch` on [`gcr.io/distroless/nodejs24-debian12`](https://github.com/GoogleContainerTools/distroless/tree/main) fails with an ENOENT error since there is no way to run `/bin/sh -c "getconf LONG_BIT"` (as distroless images don't have shells):
```
node:internal/child_process:1120
result.error = new ErrnoException(result.error, 'spawnSync ' + options.file);
^
Error: spawnSync /bin/sh ENOENT
at Object.spawnSync (node:internal/child_process:1120:20)
at spawnSync (node:child_process:878:24)
at Object.execSync (node:child_process:959:15)
at arch (/.../node_modules/arch/index.js:52:21)
at file:///.../node_modules/clipboardy/lib/windows.js:8:22
at ModuleJob.run (node:internal/modules/esm/module_job:365:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5) {
errno: -2,
code: 'ENOENT',
syscall: 'spawnSync /bin/sh',
path: '/bin/sh',
spawnargs: [ '-c', 'getconf LONG_BIT' ],
error: [Circular *1],
status: null,
signal: null,
output: null,
pid: 0,
stdout: undefined,
stderr: undefined
}
```
I know this might be a bit of a corner case, but just something that just happened :)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.