run.rst 1.1 KB

1234567891011121314151617181920212223242526272829
  1. :title: Run Command
  2. :description: Run a command in a new container
  3. :keywords: run, container, docker, documentation
  4. ===========================================
  5. ``run`` -- Run a command in a new container
  6. ===========================================
  7. ::
  8. Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
  9. Run a command in a new container
  10. -a=map[]: Attach to stdin, stdout or stderr.
  11. -c=0: CPU shares (relative weight)
  12. -d=false: Detached mode: leave the container running in the background
  13. -e=[]: Set environment variables
  14. -h="": Container host name
  15. -i=false: Keep stdin open even if not attached
  16. -m=0: Memory limit (in bytes)
  17. -p=[]: Map a network port to the container
  18. -t=false: Allocate a pseudo-tty
  19. -u="": Username or UID
  20. -d=[]: Set custom dns servers for the container
  21. -v=[]: Creates a new volume and mounts it at the specified path.
  22. -volumes-from="": Mount all volumes from the given container.
  23. -b=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro]
  24. -entrypoint="": Overwrite the default entrypoint set by the image.