Skip to content

Commit

Permalink
fix: close tmp files (wagoodman#517)
Browse files Browse the repository at this point in the history
Co-authored-by: guoguangwu <[email protected]>
Signed-off-by: guoguangwu <[email protected]>
  • Loading branch information
joschi and testwill committed Nov 6, 2024
1 parent a6386d0 commit 051fea5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dive/image/docker/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func buildImageFromCli(buildArgs []string) (string, error) {
return "", err
}
defer os.Remove(iidfile.Name())
defer iidfile.Close()

allArgs := append([]string{"--iidfile", iidfile.Name()}, buildArgs...)
err = runDockerCmd("build", allArgs...)
Expand Down
1 change: 1 addition & 0 deletions dive/image/podman/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func buildImageFromCli(buildArgs []string) (string, error) {
return "", err
}
defer os.Remove(iidfile.Name())
defer iidfile.Close()

allArgs := append([]string{"--iidfile", iidfile.Name()}, buildArgs...)
err = runPodmanCmd("build", allArgs...)
Expand Down

0 comments on commit 051fea5

Please sign in to comment.