Skip to content
Snippets Groups Projects
Commit 2b77e21b authored by Nick Thomas's avatar Nick Thomas
Browse files

Remove the build container after execution has completed

parent abc1f12d
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ type executor struct { ...@@ -50,7 +50,7 @@ type executor struct {
executors.AbstractExecutor executors.AbstractExecutor
client docker_helpers.Client client docker_helpers.Client
failures []string // IDs of containers that have failed in some way failures []string // IDs of containers that have failed in some way
builds []*types.Container builds []string // IDs of successfully created build containers
services []*types.Container services []*types.Container
caches []string // IDs of cache containers caches []string // IDs of cache containers
options dockerOptions options dockerOptions
...@@ -777,6 +777,8 @@ func (s *executor) createContainer(containerType, imageName string, cmd []string ...@@ -777,6 +777,8 @@ func (s *executor) createContainer(containerType, imageName string, cmd []string
s.failures = append(s.failures, resp.ID) s.failures = append(s.failures, resp.ID)
return nil, err return nil, err
} }
s.builds = append(s.builds, resp.ID)
return &inspect, nil return &inspect, nil
} }
...@@ -1112,8 +1114,8 @@ func (s *executor) Cleanup() { ...@@ -1112,8 +1114,8 @@ func (s *executor) Cleanup() {
remove(cacheID) remove(cacheID)
} }
for _, build := range s.builds { for _, buildID := range s.builds {
remove(build.ID) remove(buildID)
} }
wg.Wait() wg.Wait()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment