Skip to content

Commit

Permalink
fix: docker user mapping windows
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Dagelic <[email protected]>
  • Loading branch information
idagelic committed Sep 20, 2024
1 parent 0842ec9 commit 8a6635e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/docker/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"os/user"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -135,7 +136,11 @@ func (d *DockerClient) cloneProjectRepository(opts *CreateProjectOptions) error
}
}()

containerUser, err := d.updateContainerUserUidGid(c.ID, opts)
containerUser := "daytona"

if runtime.GOOS != "windows" {
containerUser, err = d.updateContainerUserUidGid(c.ID, opts)
}

res, err := d.ExecSync(c.ID, container.ExecOptions{
User: containerUser,
Expand Down
6 changes: 5 additions & 1 deletion pkg/docker/create_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package docker
import (
"context"
"fmt"
"runtime"
"time"

"github.com/daytonaio/daytona/pkg/workspace/project"
Expand Down Expand Up @@ -66,7 +67,10 @@ func (d *DockerClient) initProjectContainer(opts *CreateProjectOptions) error {
}
}()

_, err = d.updateContainerUserUidGid(c.ID, opts)
if runtime.GOOS != "windows" {
_, err = d.updateContainerUserUidGid(c.ID, opts)
}

err = d.apiClient.ContainerStop(ctx, c.ID, container.StopOptions{})
if err != nil {
return err
Expand Down

0 comments on commit 8a6635e

Please sign in to comment.