I am running a windows container on Windows Server 2016 and have made some changes on the base image. Now want to commit it but when I run
docker commit <containerId> <imageName>
I get the following error
Error response from daemon: Windows does not support commit of a running container.
Wondering if anyone has a solution to this. How would you otherwise build your containers if committing is not possible?
This now works, see this blog post for full info. All you have to do is stop the container and then use 'docker ps -a' to show all containers (even ones no longer running). Find the container you want to create the image from, then use the usual 'docker commit {containerid} {newimagename}'. Since it is no longer running, the commit will succeed and you will see the new image in the output of 'docker images ls'.
This comes from daemon/commit.go
// It is not possible to commit a running container on Windows
if runtime.GOOS == "windows" && container.IsRunning() {
return "", fmt.Errorf("Windows does not support commit of a running container")
}
As docker commit mentions:
By default, the container being committed and its processes will be paused while the image is committed.
But implementing pause resume for Windows is only now being done with PR 26795, and commit dd38389 for docker pause.
Commit could follow soon after that.
How would you otherwise build your containers if committing is not possible?
Committing is about saving a container as an image (or "building" an image), not about building a container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With