参考

环境变量

设置: docker run -e VARIABLE=VALUE ...

  1. web:
  2. environment:
  3. - DEBUG=1

常用命令

参考: https://docs.docker.com/compose/reference/overview/

  1. Define and run multi-container applications with Docker.
  2. Usage:
  3. docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
  4. docker-compose -h|--help
  5. Options:
  6. -f, --file FILE Specify an alternate compose file
  7. (default: docker-compose.yml)
  8. -p, --project-name NAME Specify an alternate project name
  9. (default: directory name)
  10. --verbose Show more output
  11. --log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  12. --no-ansi Do not print ANSI control characters
  13. -v, --version Print version and exit
  14. -H, --host HOST Daemon socket to connect to
  15. --tls Use TLS; implied by --tlsverify
  16. --tlscacert CA_PATH Trust certs signed only by this CA
  17. --tlscert CLIENT_CERT_PATH Path to TLS certificate file
  18. --tlskey TLS_KEY_PATH Path to TLS key file
  19. --tlsverify Use TLS and verify the remote
  20. --skip-hostname-check Don't check the daemon's hostname against the
  21. name specified in the client certificate
  22. --project-directory PATH Specify an alternate working directory
  23. (default: the path of the Compose file)
  24. --compatibility If set, Compose will attempt to convert deploy
  25. keys in v3 files to their non-Swarm equivalent
  26. Commands:
  27. build Build or rebuild services
  28. bundle Generate a Docker bundle from the Compose file
  29. config Validate and view the Compose file
  30. create Create services
  31. down Stop and remove containers, networks, images, and volumes
  32. events Receive real time events from containers
  33. exec Execute a command in a running container
  34. help Get help on a command
  35. images List images
  36. kill Kill containers
  37. logs View output from containers
  38. pause Pause services
  39. port Print the public port for a port binding
  40. ps List containers
  41. pull Pull service images
  42. push Push service images
  43. restart Restart services
  44. rm Remove stopped containers
  45. run Run a one-off command
  46. scale Set number of containers for a service
  47. start Start services
  48. stop Stop services
  49. top Display the running processes
  50. unpause Unpause services
  51. up Create and start containers
  52. version Show the Docker-Compose version information