commit.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. {
  16. "Entrypoint" : null,
  17. "Privileged" : false,
  18. "User" : "",
  19. "VolumesFrom" : "",
  20. "Cmd" : ["cat", "-e", "/etc/resolv.conf"],
  21. "Dns" : ["8.8.8.8", "8.8.4.4"],
  22. "MemorySwap" : 0,
  23. "AttachStdin" : false,
  24. "AttachStderr" : false,
  25. "CpuShares" : 0,
  26. "OpenStdin" : false,
  27. "Volumes" : null,
  28. "Hostname" : "122612f45831",
  29. "PortSpecs" : ["22", "80", "443"],
  30. "Image" : "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
  31. "Tty" : false,
  32. "Env" : [
  33. "HOME=/",
  34. "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  35. ],
  36. "StdinOnce" : false,
  37. "Domainname" : "",
  38. "WorkingDir" : "/",
  39. "NetworkDisabled" : false,
  40. "Memory" : 0,
  41. "AttachStdout" : false
  42. }