0

I would like to make a service like this :

datastax:
  image: luketillman/datastax-enterprise:5.1.0
  ports:
    - "9042:9042"
  volumes:
    - /datasets:/tmp/scripts
  command: [ "-s",
             "bash -c \"sleep 40 &&
                        cqlsh -f /tmp/scripts/init.cql\""]

Starts Cassandra in search mode (-s) and then (when it's up), execute init.cql via cqlsh.

Is it possible to do with compose ? How to proceed ?

1 Answer 1

1

You can run a command having multiple sub-commands like this:

datastax:
  image: luketillman/datastax-enterprise:5.1.0
  ports:
    - "9042:9042"
  volumes:
    - /datasets:/tmp/scripts
  command: bash -c "dse cassandra -s; sleep 40; cqlsh -f /tmp/scripts/init.cql"

Note that you must use the full dse cassandra -s command, you can't reuse the default command from the images AFAIK.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.