Skip to content

Create schema #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DavidRG13 opened this issue May 23, 2016 · 4 comments
Closed

Create schema #65

DavidRG13 opened this issue May 23, 2016 · 4 comments
Labels
question Usability question, not directly related to an error with the image Request Request for image modification or feature

Comments

@DavidRG13
Copy link

Hi everyone,

Is there any "standard" way of creating a schema? Or should I write my own Dockerfile/Entrypoint?

Thank you!

@varadharajan
Copy link

varadharajan commented Feb 15, 2017

I came across MySQL entry point file and i would prefer something like that.

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Apr 24, 2018
@wglambert wglambert added the Request Request for image modification or feature label May 21, 2018
@shankarshastri
Copy link

shankarshastri commented Jun 8, 2018

@DavidRG13

cassandra:
    image: cassandra
    ports:
    - "9042:9042"
    - "9160:9160"
    hostname: cassandra
    container_name: cassandra
    volumes:
      - ./random_path/random.cql:/tmp/random.cql
    command: >
            bash -c "((sleep 20s && cqlsh < /tmp/random.cql &) 
            && (/docker-entrypoint.sh cassandra -f)"

I did it like this with docker-compose.yml
In case of normal docker, we may need to wait for cassandra to come up. And once it's up, then you may need to exec into the docker container using

docker cp /random_path/random.cql cassandra:/tmp/random.cql
docker exec -i cassandra bash -c "cqlsh < /tmp/random.cql"

Or you can mount the cql files before as shown above in docker-compose.yml file.
And then run exec commands.

@awalterschulze
Copy link

We currently use this:
https://gist.github.com/awalterschulze/7732a15b555facdd9399b7f8ed9b88bf
I hope someone else can come up with something better using two phase build to build the populated schema database into the single docker.

@tianon
Copy link
Member

tianon commented Sep 20, 2018

Duplicate of #31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

6 participants