-
-
Save anonymous/df0870c4ff01190a3b51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IMAGE="XX/cassandra:2.1.1" | |
CID="/home/a/docker/cassandra/cid" | |
DOCKER_OPT="--name cassandra" | |
DOCKER_OPT="${DOCKER_OPT} -d" | |
DOCKER_OPT="${DOCKER_OPT} -p 9042:9042 -p 9160:9160" | |
DOCKER_OPT="${DOCKER_OPT} -v /mnt/docker/cassandra:/data" | |
DOCKER_OPT="${DOCKER_OPT} --cidfile $CID" | |
if [ -f $CID ]; then | |
echo "[] delet old cassandra container" | |
cat $CID | xargs --no-run-if-empty docker rm | |
rm $CID | |
fi | |
echo "[] start new cassandra container" | |
#echo "$DOCKER_OPT" | |
docker run $DOCKER_OPT $IMAGE cassandra -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment