From 9ae755da3d45e78493893e4ec19acfb857219eea Mon Sep 17 00:00:00 2001 From: adriantpaez Date: Thu, 28 Sep 2023 11:34:59 +0000 Subject: [PATCH] fix: do not remove container if AutoRemove is set --- internal/docker/docker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/docker/docker.go b/internal/docker/docker.go index 1659c30e..cdf490bc 100644 --- a/internal/docker/docker.go +++ b/internal/docker/docker.go @@ -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 {