Skip to content

Commit

Permalink
Leave mount type as nil for Windows
Browse files Browse the repository at this point in the history
		-Added a check to exclude Windows OS when adding bind mount types to container image bundle.
    -Bind types apply to Linux OS; hcsshim accepts empty bind types for Windows container creation.

Signed-off-by: Billy Owire <billyowire95@gmail.com>
  • Loading branch information
tonistiigi authored and billywr committed Sep 26, 2024
2 parents 7e4a085 + 855e120 commit 6af1547
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -400,11 +401,14 @@ type bindMount struct {
}

func (b *bindMount) Mount() ([]mount.Mount, func() error, error) {
return []mount.Mount{{
Type: "bind",
Source: b.dir,
Options: []string{"bind", "ro", "nosuid", "nodev", "noexec"},
}}, func() error { return nil }, nil
if runtime.GOOS != "windows" {
return []mount.Mount{{
Type: "bind",
Source: b.dir,
Options: []string{"bind", "ro", "nosuid", "nodev", "noexec"},
}}, func() error { return nil }, nil
}
return nil, func() error { return nil }, nil
}
func (b *bindMount) IdentityMapping() *idtools.IdentityMapping {
return nil
Expand Down

0 comments on commit 6af1547

Please sign in to comment.