Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Spin up couchbase in a container
- #
- PROGNAME=$(basename $0)
- : ${VERSION:=community-3.1.3}
- alias couchbase-cli="docker exec couchbase couchbase-cli"
- set -ex
- if test "$(docker ps --filter name=couchbase -a --format exists)" = exists; then
- docker start couchbase
- else
- docker run \
- --name couchbase \
- --detach \
- -e CB_REST_USERNAME=Administrator \
- -e CB_REST_PASSWORD=password \
- -p 8091:8091 \
- -p 8092:8092 \
- -p 8093:8093 \
- -p 8094:8094 \
- -p 11207:11207 \
- -p 11210:11210 \
- -p 11211:11211 \
- -p 18091:18091 \
- -p 18092:18092 \
- -p 18093:18093 \
- couchbase:${VERSION}
- fi
- while ! couchbase-cli bucket-list -c localhost; do
- echo "${PROGNAME}: waiting for couchbase" >&2
- sleep 1
- done
- if ! couchbase-cli bucket-list -c localhost | grep -q '^default$'; then
- couchbase-cli bucket-create -c localhost \
- --bucket=default \
- --bucket-type=couchbase \
- --bucket-password= \
- --bucket-ramsize=100 \
- --bucket-replica=0 \
- --bucket-priority=low \
- --wait
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement