Giter Club home page Giter Club logo

docker-couchbase-server's People

Contributors

abacaphiliac avatar kpankonen avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

kpankonen

docker-couchbase-server's Issues

Support for initialization scripts

I need to be able to create indexes (using cbq) and thought it might be helpful to support initialization scripts, a la docker-library/mysql.

I do think that entrypoint.sh is the right place to do it, but I'm not sure how to execute scripts via cbq after the server has started without interrupting the server's position in the container foreground.

Having said that, I did experiment with index creation in my Dockerfile. Obviously the creation of indexes should not be a docker build concern, so the following snippet is for example only.

After the couchbase-cli cluster-init and couchbase-cli bucket-create commands, you can run the following commands to create an index. Rebalance is necessary.

RUN couchbase-cli rebalance \
      --cluster=localhost:8091 \
      --no-wait \
 && cbq --engine=localhost:8093 \
      --script="CREATE INDEX \`FooBar\` ON \`${BUCKET}\`(\`FooBar\`);" -q

Building with the snippet above yields the following result:

SUCCESS: Cluster initialized
SUCCESS: Bucket created
SUCCESS: Rebalance started
{
    "requestID": "58a0c2d5-2b0c-46a4-bf59-58e5d11c648e",
    "signature": null,
    "results": [
    ],
    "errors": [
        {
            "code": 13014,
            "msg": "User does not have credentials to run index operations. Add role query_manage_index on default to allow the query to run."
        }
    ],
    "status": "stopped",
    "metrics": {
        "elapsedTime": "55.569555ms",
        "executionTime": "55.465996ms",
        "resultCount": 0,
        "resultSize": 0,
        "errorCount": 1
    }
}
Removing intermediate container 750a8462e43e
 ---> 548cb41cb284
Step 33/34 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Running in e5592a3bb6b0
Removing intermediate container e5592a3bb6b0
 ---> 882cc6455c5c
Step 34/34 : CMD ["couchbase-server"]
 ---> Running in d168f7aeaef0
Removing intermediate container d168f7aeaef0
 ---> c6bc36d17677
Successfully built c6bc36d17677

I believe there is an open issue to resolve User does not have credentials to run index operations. Add role query_manage_index on default to allow the query to run. in Couchbase CE.

We might not be able to support all types of initialization scripts until that upstream issue is resolved.

That being said, initialization script support may still be beneficial.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.