Docker commit vs export

What is the difference between docker export and commit and when to use ?

Please check here:
https://docs.docker.com/engine/reference/commandline/export/

https://docs.docker.com/engine/reference/commandline/commit/

Thanks,
Trung Tran.

docker export and docker commit are both used in Docker to create new images, but they have different functionalities.

docker export allows you to export the contents of a container as a tarball file. This means that you can save the state of the container at a particular point in time and share it with others. However, you can’t use the exported file to recreater its image.

On the other hand, docker commit allows you to create a new image from an existing container. This means that you can modify the container and then save it as a new image. You can then use this image to recreate the container or create new containers based on it.

1 Like