1
0
mirror of https://github.com/rancher/os.git synced 2025-06-27 23:36:49 +00:00

Godep updates

This commit is contained in:
Darren Shepherd 2015-04-22 14:25:45 -07:00
parent cd78981878
commit b2ece71237
2 changed files with 40 additions and 31 deletions

8
Godeps/Godeps.json generated
View File

@ -221,13 +221,13 @@
},
{
"ImportPath": "github.com/rancherio/rancher-compose/docker",
"Comment": "0.1.0-12-g8fecf18",
"Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482"
"Comment": "0.1.0-13-g0694d95",
"Rev": "0694d95502831b4d22422ff623889cf70bc017e2"
},
{
"ImportPath": "github.com/rancherio/rancher-compose/project",
"Comment": "0.1.0-12-g8fecf18",
"Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482"
"Comment": "0.1.0-13-g0694d95",
"Rev": "0694d95502831b4d22422ff623889cf70bc017e2"
},
{
"ImportPath": "github.com/ryanuber/go-glob",

View File

@ -3,6 +3,7 @@ package docker
import (
"strings"
"github.com/docker/docker/nat"
"github.com/docker/docker/runconfig"
"github.com/rancherio/rancher-compose/project"
@ -17,8 +18,13 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig
cmd, _ := shlex.Split(c.Command)
entrypoint, _ := shlex.Split(c.Entrypoint)
ports, binding, err := nat.ParsePortSpecs(c.Ports)
return &runconfig.Config{
if err != nil {
return nil, nil, err
}
config := &runconfig.Config{
Entrypoint: entrypoint,
Hostname: c.Hostname,
Domainname: c.DomainName,
@ -29,8 +35,9 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig
Cmd: cmd,
Image: c.Image,
Labels: kvListToMap(c.Labels),
},
&runconfig.HostConfig{
ExposedPorts: ports,
}
host_config := &runconfig.HostConfig{
VolumesFrom: c.VolumesFrom,
CapAdd: c.CapAdd,
CapDrop: c.CapDrop,
@ -44,8 +51,10 @@ func Convert(c *project.ServiceConfig) (*runconfig.Config, *runconfig.HostConfig
ReadonlyRootfs: c.ReadOnly,
PidMode: runconfig.PidMode(c.Pid),
IpcMode: runconfig.IpcMode(c.Ipc),
},
nil
PortBindings: binding,
}
return config, host_config, nil
}
func kvListToMap(list []string) map[string]string {