1
0
mirror of https://github.com/rancher/os.git synced 2025-06-28 15:56:58 +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", "ImportPath": "github.com/rancherio/rancher-compose/docker",
"Comment": "0.1.0-12-g8fecf18", "Comment": "0.1.0-13-g0694d95",
"Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482" "Rev": "0694d95502831b4d22422ff623889cf70bc017e2"
}, },
{ {
"ImportPath": "github.com/rancherio/rancher-compose/project", "ImportPath": "github.com/rancherio/rancher-compose/project",
"Comment": "0.1.0-12-g8fecf18", "Comment": "0.1.0-13-g0694d95",
"Rev": "8fecf186bdab6b14c9f625f9499f959fd8590482" "Rev": "0694d95502831b4d22422ff623889cf70bc017e2"
}, },
{ {
"ImportPath": "github.com/ryanuber/go-glob", "ImportPath": "github.com/ryanuber/go-glob",

View File

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