Skip to content

Commit

Permalink
Merge pull request #7947 from hashicorp/b-docker-image-cleanup
Browse files Browse the repository at this point in the history
docker: Fix docker image gc tracking
  • Loading branch information
Mahmood Ali committed May 13, 2020
2 parents e72effc + 72c08e0 commit 71037b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/docker/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,6 @@ func (d *Driver) createImage(task *drivers.TaskConfig, driverConfig *TaskConfig,
image := driverConfig.Image
repo, tag := parseDockerImage(image)

callerID := fmt.Sprintf("%s-%s", task.ID, task.Name)

// We're going to check whether the image is already downloaded. If the tag
// is "latest", or ForcePull is set, we have to check for a new version every time so we don't
// bother to check and cache the id here. We'll download first, then cache.
Expand All @@ -529,7 +527,7 @@ func (d *Driver) createImage(task *drivers.TaskConfig, driverConfig *TaskConfig,
} else if tag != "latest" {
if dockerImage, _ := client.InspectImage(image); dockerImage != nil {
// Image exists so just increment its reference count
d.coordinator.IncrementImageReference(dockerImage.ID, image, callerID)
d.coordinator.IncrementImageReference(dockerImage.ID, image, task.ID)
return dockerImage.ID, nil
}
}
Expand Down

0 comments on commit 71037b4

Please sign in to comment.