mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove runtime options from config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
36af2936af
commit
e2779e11db
2 changed files with 2 additions and 14 deletions
|
@ -1,10 +1,8 @@
|
|||
package runconfig
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/dotcloud/docker/engine"
|
||||
"github.com/dotcloud/docker/nat"
|
||||
"github.com/dotcloud/docker/runtime/execdriver"
|
||||
)
|
||||
|
||||
// Note: the Config structure should hold only portable information about the container.
|
||||
|
@ -36,17 +34,9 @@ type Config struct {
|
|||
Entrypoint []string
|
||||
NetworkDisabled bool
|
||||
OnBuild []string
|
||||
Context execdriver.Context
|
||||
}
|
||||
|
||||
func ContainerConfigFromJob(job *engine.Job) *Config {
|
||||
var context execdriver.Context
|
||||
val := job.Getenv("Context")
|
||||
if val != "" {
|
||||
if err := json.Unmarshal([]byte(val), &context); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
config := &Config{
|
||||
Hostname: job.Getenv("Hostname"),
|
||||
Domainname: job.Getenv("Domainname"),
|
||||
|
@ -64,7 +54,6 @@ func ContainerConfigFromJob(job *engine.Job) *Config {
|
|||
VolumesFrom: job.Getenv("VolumesFrom"),
|
||||
WorkingDir: job.Getenv("WorkingDir"),
|
||||
NetworkDisabled: job.GetenvBool("NetworkDisabled"),
|
||||
Context: context,
|
||||
}
|
||||
job.GetenvJson("ExposedPorts", &config.ExposedPorts)
|
||||
job.GetenvJson("Volumes", &config.Volumes)
|
||||
|
@ -86,6 +75,5 @@ func ContainerConfigFromJob(job *engine.Job) *Config {
|
|||
if Entrypoint := job.GetenvList("Entrypoint"); Entrypoint != nil {
|
||||
config.Entrypoint = Entrypoint
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ func (runtime *Runtime) Create(config *runconfig.Config, name string) (*Containe
|
|||
}
|
||||
|
||||
initID := fmt.Sprintf("%s-init", container.ID)
|
||||
if err := runtime.driver.Create(initID, img.ID, config.Context["mount_label"]); err != nil {
|
||||
if err := runtime.driver.Create(initID, img.ID, ""); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
initPath, err := runtime.driver.Get(initID)
|
||||
|
@ -512,7 +512,7 @@ func (runtime *Runtime) Create(config *runconfig.Config, name string) (*Containe
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
if err := runtime.driver.Create(container.ID, initID, config.Context["mount_label"]); err != nil {
|
||||
if err := runtime.driver.Create(container.ID, initID, ""); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
resolvConf, err := utils.GetResolvConf()
|
||||
|
|
Loading…
Add table
Reference in a new issue