Skip to content

Commit

Permalink
Add support for devfs on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Dec 24, 2023
1 parent 5fd92f9 commit 7afee92
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions oci/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,33 @@ func DefaultPathEnv(os string) string {

// DefaultSpec returns the default spec used by docker for the current Platform
func DefaultSpec() specs.Spec {
if runtime.GOOS == "windows" {
switch runtime.GOOS {
case "darwin":
return DefaultDarwinSpec()
case "windows":
return DefaultWindowsSpec()
default:
return DefaultLinuxSpec()
}
}

// DefaultWindowsSpec create a default spec for running Darwin containers
func DefaultDarwinSpec() specs.Spec {
return specs.Spec{
Version: specs.Version,
Windows: &specs.Windows{},
Process: &specs.Process{},
Root: &specs.Root{},
Linux: &specs.Linux{},
Mounts: []specs.Mount{
{
Destination: "/dev",
Type: "devfs",
Source: "devfs",
Options: []string{},
},
},
}
return DefaultLinuxSpec()
}

// DefaultWindowsSpec create a default spec for running Windows containers
Expand Down

0 comments on commit 7afee92

Please sign in to comment.