100-Days-Of-DevOps-Challenge-KodeKloud

Create a Docker Image From a Container

One of the Nautilus developer was working to test new changes on a container. He wants to keep a backup of his changes to the container. A new request has been raised for the DevOps team to create a new image from this container. Below are more details about it:

Steps

To create a docker image from a running container, we can use the following command:

docker commit container-name image-repository:tag

In this case, the actual command is:

docker commit ubuntu_latest ecommerce:nautilus

Good to Know?

Docker Commit

When to Use Commit

Commit vs Dockerfile

Best Practices