fixed some issues with container downloads

This commit is contained in:
Brad Rydzewski 2015-05-15 16:24:10 -07:00
parent d66becd12c
commit 6414d4e21e
3 changed files with 6 additions and 2 deletions

View file

@ -182,7 +182,7 @@ func daemon(client dockerclient.Client, conf *dockerclient.ContainerConfig, pull
id, err = client.CreateContainer(conf, "") id, err = client.CreateContainer(conf, "")
// make sure the container is removed in // make sure the container is removed in
// the event of a creation error. // the event of a creation error.
if len(id) != 0 { if err != nil && len(id) != 0 {
client.RemoveContainer(id, true, true) client.RemoveContainer(id, true, true)
} }
if err != nil { if err != nil {

View file

@ -24,6 +24,10 @@ func toContainerConfig(step *common.Step) *dockerclient.ContainerConfig {
}, },
} }
if len(config.Entrypoint) == 0 {
config.Entrypoint = nil
}
config.Volumes = map[string]struct{}{} config.Volumes = map[string]struct{}{}
for _, path := range step.Volumes { for _, path := range step.Volumes {
if strings.Index(path, ":") == -1 { if strings.Index(path, ":") == -1 {

View file

@ -170,7 +170,7 @@ func run(client dockerclient.Client, conf *dockerclient.ContainerConfig, name st
id, err = client.CreateContainer(conf, name) id, err = client.CreateContainer(conf, name)
// make sure the container is removed in // make sure the container is removed in
// the event of a creation error. // the event of a creation error.
if len(id) != 0 { if err != nil && len(id) != 0 {
client.RemoveContainer(id, true, true) client.RemoveContainer(id, true, true)
} }
if err != nil { if err != nil {