docker_app.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. ###############################################################################
  3. # 运行 docker 镜像
  4. ###############################################################################
  5. set -e
  6. function start() {
  7. docker run -d --name=tnbeureka --network=host -v /opt/log:/app/logs tnb/eureka
  8. docker run -d --name=tnbgateway --network=host -v /opt/log:/app/logs tnb/gateway
  9. docker run -d --name=tnbaccount --network=host -v /opt/log:/app/logs tnb/account
  10. docker run -d --name=tnbmessage --network=host -v /opt/log:/app/logs tnb/message
  11. docker run -d --name=tnbfile --network=host -v /opt/log:/app/logs tnb/file
  12. docker run -d --name=tnbuser --network=host -v /opt/log:/app/logs tnb/user
  13. docker run -d --name=tnbcontent --network=host -v /opt/log:/app/logs tnb/content
  14. docker run -d --name=tnbsearch --network=host -v /opt/log:/app/logs tnb/search
  15. }
  16. function shutdown() {
  17. docker stop tnbeureka && docker rm tnbeureka
  18. docker stop tnbgateway && docker rm tnbgateway
  19. docker stop tnbaccount && docker rm tnbaccount
  20. docker stop tnbmessage && docker rm tnbmessage
  21. docker stop tnbfile && docker rm tnbfile
  22. docker stop tnbuser && docker rm tnbuser
  23. docker stop tnbcontent && docker rm tnbcontent
  24. docker stop tnbsearch && docker rm tnbsearch
  25. }
  26. start
  27. #shutdown