Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
fix: do not remove container if AutoRemove is set
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantpaez committed Sep 28, 2023
1 parent bfc9355 commit 9ae755d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ func (d *DockerManager) Run(image string, options RunOptions) (err error) {

// Ensure the container is removed after use
defer func() {
if options.AutoRemove {
return
}
log.Debugf("Removing container %s", createResponse.ID)
removeErr := d.dockerClient.ContainerRemove(context.Background(), createResponse.ID, types.ContainerRemoveOptions{})
if removeErr != nil {
Expand Down

0 comments on commit 9ae755d

Please sign in to comment.