reid %!s(int64=2) %!d(string=hai) anos
pai
achega
ea68220108
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      docker/wireguard.go

+ 5 - 0
docker/wireguard.go

@@ -150,5 +150,10 @@ func copyFileToVolume(filePath string, targetPath string, volumeName string) err
 	if err := cli.ContainerRemove(ctx, resp.ID, types.ContainerRemoveOptions{Force: true}); err != nil {
 		return err
 	}
+	defer func() {
+		if removeErr := cli.ContainerRemove(ctx, resp.ID, types.ContainerRemoveOptions{Force: true}); removeErr != nil {
+			logger.Error("Failed to remove temporary container: ", removeErr)
+		}
+	}()
 	return nil
 }