我想提供这样的服务:
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\""]在搜索模式(-s)中启动Cassandra,然后(当它启动时),通过cqlsh执行init.cql。
可以用写作来做吗?怎么继续?
发布于 2018-04-20 07:35:53
您可以运行一个具有以下多个子命令的命令:
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"注意,必须使用完整的dse cassandra -s命令,不能重用图像AFAIK中的默认命令。
https://stackoverflow.com/questions/49935674
复制相似问题