Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -o verbose
- # This script will create a new service. To make sure that there are no
- # name collissions we will add a timestamp to the name of the service
- # and the data volume.
- TIMESTAMP=$( date '+%s' )
- VOLNAME="percona_new_vol_${TIMESTAMP}"
- SRVNAME="percona_new_srv_${TIMESTAMP}"
- USER_AND_DB="wordpress01"
- PASSWORD="changeme"
- docker volume create -d ontap-nas -o size=10g -o snapshotDir=false -o snapshotPolicy=default --name ${VOLNAME}
- docker service create \
- --name ${SRVNAME} \
- -e "MYSQL_ROOT_PASSWORD=${PASSWORD}" \
- -e "MYSQL_PASSWORD=${PASSWORD}" \
- -e "MYSQL_USER=${USER_AND_DB}" \
- -e "MYSQL_DATABASE=${USER_AND_DB}" \
- --mount src=${VOLNAME},dst=/var/lib/mysql \
- -p 3307:3306 \
- percona:latest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement