Docker’s commit command allows users to take a running container and save its current state as an image. This means to add our new user, we will need a running container. To get started, let’s go ahead and launch a Redis container with the docker run command.
Does docker commit save files?
After the docker commit command, you can use docker save to save your image in a tar, and docker load to import it back, as shown here.
Should you commit Dockerfile?
2 Answers. Dockerfiles are a tool that is used to create images. The result of running docker build . is an image with a commit so it’s not possible to use a Dockerfile with out creating a commit.