Skip to content

Commit

Permalink
fix: mount /tmp as tmpfs by default, ensure compatibility with regula…
Browse files Browse the repository at this point in the history
…r linux distributions

Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Jan 31, 2024
1 parent a3a3c66 commit fc1fe64
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/driver/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,20 @@ func (d *dockerDriver) RunDockerDevContainer(
}

// mounts
tmpfsMount := true
for _, mount := range options.Mounts {
// skip tmpfs mount on /tmp if devcontainer specifies another mount option
if strings.Contains(mount.String(), "/tmp") {
tmpfsMount = false
}
args = append(args, "--mount", mount.String())
}

// ensure /tmp is a tmpfs like on regular linux distros
if tmpfsMount {
args = append(args, "--mount", "type=tmpfs,destination=/tmp")
}

// add ide mounts
switch ide {
case string(config2.IDEGoland):
Expand Down

0 comments on commit fc1fe64

Please sign in to comment.