run.rst 1.2 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. -cidfile="": Write the container ID to the file
  13. -d=false: Detached mode: leave the container running in the background
  14. -e=[]: Set environment variables
  15. -h="": Container host name
  16. -i=false: Keep stdin open even if not attached
  17. -m=0: Memory limit (in bytes)
  18. -p=[]: Map a network port to the container
  19. -t=false: Allocate a pseudo-tty
  20. -u="": Username or UID
  21. -d=[]: Set custom dns servers for the container
  22. -v=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro]. If "host-dir" is missing, then docker creates a new volume.
  23. -volumes-from="": Mount all volumes from the given container.
  24. -entrypoint="": Overwrite the default entrypoint set by the image.