run.rst 988 B

123456789101112131415161718192021222324252627
  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.