Reputation: 45
Since volume service is not yet available on Swisscom is it possible to do something like this with docker on Swisscom cloud foundry:
docker run -d --volume /mydata --name elastic-shared alpine echo My Data Container
docker run -d --volumes-from elastic-shared --name myelastic elasticsearch:latest
One container will be used as a volume for the other container running elasticseach as persistent data storage.
Upvotes: 1
Views: 137
Reputation: 474
Alright, I see what you're trying to do but there's sone major issue with it: All application containers MUST be stateless. Just saying "I'll never restart the app that serves as a persistent volume" isn't going to make it persistent. Your app can (and will!) be rescheduled or restarted by CF at any time for various reasons.
That's also one of the major reasons why there is no volume sharing between applications, meaning that no, there's no CF equivalent to docker's --volumes-from.
Obviously, this also means using logstash in a way where it stores its state in the local filesystem is a bad idea.
Since there's no NFS volumes available on the Swisscom Application Cloud, your best bet might be to somehow store the state in S3, but I'm not sure that can be achieved (other than storing snapshots).
Upvotes: 1