commit.rst 1011 B

1234567891011121314151617181920212223242526272829303132
  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 run. "+`(ex: {"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}')
  13. Full -run example::
  14. {"Hostname": "",
  15. "User": "",
  16. "CpuShares": 0,
  17. "Memory": 0,
  18. "MemorySwap": 0,
  19. "PortSpecs": ["22", "80", "443"],
  20. "Tty": true,
  21. "OpenStdin": true,
  22. "StdinOnce": true,
  23. "Env": ["FOO=BAR", "FOO2=BAR2"],
  24. "Cmd": ["cat", "-e", "/etc/resolv.conf"],
  25. "Dns": ["8.8.8.8", "8.8.4.4"]}