# nerdctl_image_commit

Commit a container's changes to a new image.

```rhai
nerdctl_image_commit(container, image_name) -> CommandResult
```

## Parameters

- `container` (string): Container name or ID
- `image_name` (string): Name for the new image

## Returns

Returns a `CommandResult` with the commit operation output.

## Examples

```rhai
// Create and modify a container
let container = nerdctl_container_from_image("temp", "alpine:latest")
    .build();
    
container.start();
container.exec("apk add curl");
container.stop();

// Commit the changes to a new image
let result = nerdctl_image_commit("temp", "alpine-curl:latest");
print("Image created: " + result.success);
```

## Notes

- Creates a new image from container's current state
- Container can be running or stopped
- Useful for saving container modifications
