Guest User

Untitled

a guest
May 29th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. Run a one-off command on a service.
  2.  
  3. For example:
  4.  
  5. $ docker-compose run web python manage.py shell
  6.  
  7. By default, linked services will be started, unless they are already
  8. running. If you do not want to start linked services, use
  9. `docker-compose run --no-deps SERVICE COMMAND [ARGS...]`.
  10.  
  11. Usage:
  12. run [options] [-v VOLUME...] [-p PORT...] [-e KEY=VAL...] [-l KEY=VALUE...]
  13. SERVICE [COMMAND] [ARGS...]
  14.  
  15. Options:
  16. -d, --detach Detached mode: Run container in the background, print
  17. new container name.
  18. --name NAME Assign a name to the container
  19. --entrypoint CMD Override the entrypoint of the image.
  20. -e KEY=VAL Set an environment variable (can be used multiple times)
  21. -l, --label KEY=VAL Add or override a label (can be used multiple times)
  22. -u, --user="" Run as specified username or uid
  23. --no-deps Don't start linked services.
  24. --rm Remove container after run. Ignored in detached mode.
  25. -p, --publish=[] Publish a container's port(s) to the host
  26. --service-ports Run command with the service's ports enabled and mapped
  27. to the host.
  28. --use-aliases Use the service's network aliases in the network(s) the
  29. container connects to.
  30. -v, --volume=[] Bind mount a volume (default [])
  31. -T Disable pseudo-tty allocation. By default `docker-compose run`
  32. allocates a TTY.
  33. -w, --workdir="" Working directory inside the container
Add Comment
Please, Sign In to add comment