Skip to content

Commit

Permalink
container: add Devices to HostConfig
Browse files Browse the repository at this point in the history
This will allow containers to have access to devices in the Docker host.
Closes #241.
  • Loading branch information
fsouza committed Mar 18, 2015
1 parent 2022008 commit e4fcc92
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,14 @@ func NeverRestart() RestartPolicy {
return RestartPolicy{Name: "no"}
}

// Device represents a device mapping between the Docker host and the
// container.
type Device struct {
PathOnHost string
PathInContainer string
CgroupPermissions string
}

// HostConfig contains the container options related to starting a container on
// a given host
type HostConfig struct {
Expand All @@ -396,6 +404,7 @@ type HostConfig struct {
IpcMode string `json:"IpcMode,omitempty" yaml:"IpcMode,omitempty"`
PidMode string `json:"PidMode,omitempty" yaml:"PidMode,omitempty"`
RestartPolicy RestartPolicy `json:"RestartPolicy,omitempty" yaml:"RestartPolicy,omitempty"`
Devices []Device `json:"Devices,omitempty" yaml:"Devices,omitempty"`
}

// StartContainer starts a container, returning an error in case of failure.
Expand Down

0 comments on commit e4fcc92

Please sign in to comment.