mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
fixed some issues with container downloads
This commit is contained in:
parent
d66becd12c
commit
6414d4e21e
3 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue