Reputation: 1044
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 ?
Upvotes: 0
Views: 415
Reputation: 17683
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.
Upvotes: 1