Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. set -o verbose
  4.  
  5. # This script will create a new service. To make sure that there are no
  6. # name collissions we will add a timestamp to the name of the service
  7. # and the data volume.
  8. TIMESTAMP=$( date '+%s' )
  9. VOLNAME="percona_new_vol_${TIMESTAMP}"
  10. SRVNAME="percona_new_srv_${TIMESTAMP}"
  11. USER_AND_DB="wordpress01"
  12. PASSWORD="changeme"
  13.  
  14. docker volume create -d ontap-nas -o size=10g -o snapshotDir=false -o snapshotPolicy=default --name ${VOLNAME}
  15.  
  16. docker service create \
  17. --name ${SRVNAME} \
  18. -e "MYSQL_ROOT_PASSWORD=${PASSWORD}" \
  19. -e "MYSQL_PASSWORD=${PASSWORD}" \
  20. -e "MYSQL_USER=${USER_AND_DB}" \
  21. -e "MYSQL_DATABASE=${USER_AND_DB}" \
  22. --mount src=${VOLNAME},dst=/var/lib/mysql \
  23. -p 3307:3306 \
  24. percona:latest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement