Skip to content

Commit bd80e3e

Browse files
committed
fix: node user path
1 parent 9277809 commit bd80e3e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

toolbox/sandbox/container.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"dagger/sandbox/internal/dagger"
66
"fmt"
7+
"strings"
78
)
89

910
// renovate: datasource=github-releases depName=dandavison/delta
@@ -28,6 +29,16 @@ func (s *Sandbox) Container(ctx context.Context,
2829
gitDeltaVersion,
2930
)
3031

32+
nodeUserPath := []string{
33+
"/usr/local/sbin",
34+
"/usr/local/bin",
35+
"/usr/sbin",
36+
"/usr/bin",
37+
"/sbin",
38+
"/bin",
39+
"/usr/local/share/npm-global/bin",
40+
}
41+
3142
return dag.Container().
3243
From(baseImage).
3344
WithEnvVariable("TZ", tz).
@@ -82,16 +93,20 @@ func (s *Sandbox) Container(ctx context.Context,
8293
).
8394
WithEnvVariable(
8495
"PATH",
85-
"/usr/local/bin:/usr/bin:/bin:/usr/local/share/npm-global/bin",
96+
strings.Join(nodeUserPath, ":"),
8697
).
98+
8799
// Set fish as default shell
88100
WithEnvVariable("SHELL", "/usr/bin/fish").
89101
// Install Claude CLI using full path
90-
WithExec([]string{"/usr/local/bin/npm", "install", "-g", "@anthropic-ai/claude-code"}).
102+
WithExec([]string{
103+
"/usr/local/bin/npm", "install", "-g", "@anthropic-ai/claude-code",
104+
}).
91105
// Copy and set up firewall script
92106
WithFile("/usr/local/bin/init-firewall.sh",
93107
dag.CurrentModule().Source().File("init-firewall.sh"),
94-
dagger.ContainerWithFileOpts{Permissions: 0755}).
108+
dagger.ContainerWithFileOpts{Permissions: 0755},
109+
).
95110
WithUser("root").
96111
WithExec([]string{
97112
"sh", "-c",

0 commit comments

Comments
 (0)