0

What is the difference between the following two commands:

docker container commit 

docker commit

I read the documentation for both the commands but couldn't found any difference between the two commands(Also both the commands contain the same options).

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

The help page of both the commands show the same output on Docker 19.03

Usage:  docker container commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Create a new image from a container's changes

Options:
  -a, --author string    Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
  -c, --change list      Apply Dockerfile instruction to the created image
  -m, --message string   Commit message
  -p, --pause            Pause container during commit (default true)
Kapil Khandelwal
  • 1,096
  • 12
  • 19
  • 1
    They are identical, from a historical renaming. You should never run either; `docker build` / `docker image build` is the right way to create an image, based on a script you can check into source control. – David Maze Mar 22 '20 at 11:05
  • 2
    @DavidMaze -- 'never' is a very strong word. Rather, it is better to issue an admonishment that the use of this is uncommon and that it should only be undertaken with extreme caution. But, it exists for good reasons and shouldn't be completely unused. – Software Engineer Mar 22 '20 at 11:41

0 Answers0