commit.rst 1018 B

123456789101112131415161718192021222324252627282930313233
  1. :title: Commit Command
  2. :description: Create a new image from a container's changes
  3. :keywords: commit, docker, container, documentation
  4. ===========================================================
  5. ``commit`` -- Create a new image from a container's changes
  6. ===========================================================
  7. ::
  8. Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY [TAG]]
  9. Create a new image from a container's changes
  10. -m="": Commit message
  11. -author="": Author (eg. "John Hannibal Smith <hannibal@a-team.com>"
  12. -run="": Config automatically applied when the image is
  13. run. "+`(ex: {"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}')
  14. Full -run example::
  15. {"Hostname": "",
  16. "User": "",
  17. "CpuShares": 0,
  18. "Memory": 0,
  19. "MemorySwap": 0,
  20. "PortSpecs": ["22", "80", "443"],
  21. "Tty": true,
  22. "OpenStdin": true,
  23. "StdinOnce": true,
  24. "Env": ["FOO=BAR", "FOO2=BAR2"],
  25. "Cmd": ["cat", "-e", "/etc/resolv.conf"],
  26. "Dns": ["8.8.8.8", "8.8.4.4"]}