Skip to content

Commit 3bd926d

Browse files
authored
Merge pull request #16 from Cloud-Exit/feat/add-dotnet-lang
Add .NET support, fix Windows Docker build
2 parents c459b77 + bc73499 commit 3bd926d

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

cmd/list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ var listCmd = &cobra.Command{
7474
fmt.Println(" exitbox rebuild <agent> Force rebuild of agent image")
7575
fmt.Println(" exitbox rebuild all Rebuild all enabled agents")
7676
fmt.Println(" exitbox import <agent> Import agent config from host")
77+
fmt.Println(" exitbox skills Install, list, and remove skills for AI coding agents")
7778
fmt.Println(" exitbox workspaces Manage workspaces")
7879
fmt.Println(" exitbox sessions Manage sessions")
7980
fmt.Println(" exitbox vault Manage vault secrets")

internal/image/base.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
"github.com/cloud-exit/exitbox/internal/config"
2929
"github.com/cloud-exit/exitbox/internal/container"
30+
"github.com/cloud-exit/exitbox/internal/platform"
3031
"github.com/cloud-exit/exitbox/internal/ui"
3132
"github.com/cloud-exit/exitbox/static"
3233
)
@@ -242,11 +243,12 @@ func buildLocalIntermediary(ctx context.Context, rt container.Runtime, cmd, base
242243
}
243244
}
244245

246+
uid, gid := platform.HostUIDGID()
245247
args := buildArgs(cmd)
246248
args = append(args,
247249
"--build-arg", fmt.Sprintf("BASE_IMAGE=%s", baseRef),
248-
"--build-arg", fmt.Sprintf("USER_ID=%d", os.Getuid()),
249-
"--build-arg", fmt.Sprintf("GROUP_ID=%d", os.Getgid()),
250+
"--build-arg", fmt.Sprintf("USER_ID=%d", uid),
251+
"--build-arg", fmt.Sprintf("GROUP_ID=%d", gid),
250252
"--build-arg", "USERNAME=user",
251253
"-t", imageName,
252254
"-f", dockerfilePath,

internal/platform/platform.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,25 @@
1717
// Package platform provides OS and architecture detection.
1818
package platform
1919

20-
import "runtime"
20+
import (
21+
"os"
22+
"runtime"
23+
)
24+
25+
const (
26+
DefaultContainerUID = 1000
27+
DefaultContainerGID = 1000
28+
)
29+
30+
// HostUIDGID returns host user and group IDs for Docker build args.
31+
// On Windows it returns -1 and in this case returns DefaultContainerUID:DefaultContainerGID
32+
func HostUIDGID() (uid, gid int) {
33+
uid, gid = os.Getuid(), os.Getgid()
34+
if uid < 0 || gid < 0 {
35+
return DefaultContainerUID, DefaultContainerGID
36+
}
37+
return uid, gid
38+
}
2139

2240
// DetectOS returns the current operating system as a normalized string.
2341
func DetectOS() string {

internal/profile/profile.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func All() []Profile {
3838
{"rust", "Rust toolchain (rust + cargo via apk)", "rust cargo"},
3939
{"go", "Go runtime (latest stable for host arch, checksum verified)", ""},
4040
{"java", "OpenJDK with Maven and Gradle", "openjdk17-jdk maven gradle"},
41+
{"dotnet", ".NET 8 SDK (dotnet CLI)", "dotnet8-sdk"},
4142
{"ruby", "Ruby runtime with bundler", "ruby ruby-dev readline-dev yaml-dev sqlite-dev sqlite libxml2-dev libxslt-dev curl-dev"},
4243
{"php", "PHP runtime with composer", "php83 php83-cli php83-fpm php83-mysqli php83-pgsql php83-sqlite3 php83-curl php83-gd php83-mbstring php83-xml php83-zip composer"},
4344
{"database", "Database CLI clients (Postgres, MySQL/MariaDB, SQLite, Redis)", "postgresql16-client mariadb-client sqlite redis"},

internal/run/run.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/cloud-exit/exitbox/internal/generate"
3434
"github.com/cloud-exit/exitbox/internal/ipc"
3535
"github.com/cloud-exit/exitbox/internal/network"
36+
"github.com/cloud-exit/exitbox/internal/platform"
3637
"github.com/cloud-exit/exitbox/internal/profile"
3738
"github.com/cloud-exit/exitbox/internal/project"
3839
"github.com/cloud-exit/exitbox/internal/redactor"
@@ -264,8 +265,9 @@ func AgentContainer(rt container.Runtime, opts Options) (int, error) {
264265
}
265266
args = append(args, "-w", "/workspace", "-v", opts.ProjectDir+":/workspace"+mountMode)
266267

267-
// Non-root
268-
args = append(args, "--user", fmt.Sprintf("%d:%d", os.Getuid(), os.Getgid()))
268+
// Non-root (Windows: os.Getuid/Getgid are -1)
269+
runUID, runGID := platform.HostUIDGID()
270+
args = append(args, "--user", fmt.Sprintf("%d:%d", runUID, runGID))
269271

270272
// Include dirs
271273
for _, dir := range opts.IncludeDirs {

internal/wizard/roles.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ var Roles = []Role{
7878
{
7979
Name: "Fullstack",
8080
Description: "Full-stack web development",
81-
Profiles: []string{"node", "python", "database", "web", "build-tools"},
82-
Languages: []string{"Node/JS", "Python"},
81+
Profiles: []string{"node", "python", "database", "web", "dotnet", "build-tools"},
82+
Languages: []string{"Node/JS", "Python", ".NET"},
8383
ToolCategories: []string{"Build Tools", "Database", "Web"},
8484
},
8585
{
@@ -133,6 +133,7 @@ var AllLanguages = []Language{
133133
{Name: "Node/JS", Profile: "node"},
134134
{Name: "Rust", Profile: "rust"},
135135
{Name: "Java", Profile: "java"},
136+
{Name: ".NET", Profile: "dotnet"},
136137
{Name: "Ruby", Profile: "ruby"},
137138
{Name: "PHP", Profile: "php"},
138139
{Name: "C/C++", Profile: "c"},

0 commit comments

Comments
 (0)