Skip to content

Commit

Permalink
Remove runtime options from config
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
  • Loading branch information
crosbymichael committed Apr 3, 2014
1 parent 36af293 commit e2779e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions runconfig/config.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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"),
Expand All @@ -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)
Expand All @@ -86,6 +75,5 @@ func ContainerConfigFromJob(job *engine.Job) *Config {
if Entrypoint := job.GetenvList("Entrypoint"); Entrypoint != nil {
config.Entrypoint = Entrypoint
}

return config
}
4 changes: 2 additions & 2 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit e2779e1

Please sign in to comment.