You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Swisscom Cloud Foundry无卷服务时,Docker数据容器挂载方案可行吗?

Using Docker Data Containers for Elasticsearch Persistence on Swisscom Cloud Foundry

First, let's cut to the chase: This approach won't work as expected on Swisscom Cloud Foundry, and here's why, plus some practical alternatives to hit your data persistence goal.

Why --volumes-from fails in Cloud Foundry

Cloud Foundry (including Swisscom's deployment) uses the Diego runtime to manage application containers, which is built for stateless, isolated app instances. Key reasons your Docker volume-sharing pattern won't translate here:

  • Each app runs in a fully isolated environment. Your elastic-shared and myelastic containers could be scheduled on entirely different hosts, or locked into separate Docker namespaces—so they can't access each other's volumes at all.
  • Cloud Foundry doesn't expose raw Docker flags like --volumes-from in its cf push workflow. Even if you hardcode this into your container's start command, the target volume from another app's container will be unreachable.
  • Any local Docker volume storage is ephemeral in Cloud Foundry. If your app instance restarts or gets rescheduled, all data in that volume (even in a "data container") will be lost permanently.

Alternatives for Elasticsearch Persistence on Swisscom Cloud Foundry

Since you need reliable persistent storage for Elasticsearch, here are workable paths forward:

  1. Check for a managed Elasticsearch service
    • Run cf marketplace to see if Swisscom has added an Elasticsearch offering to their service catalog (they may have added it since you asked!). Look for official or third-party options like Compose for Elasticsearch.
  2. Use external object storage with Elasticsearch plugins
    • Elasticsearch supports plugins (like the S3 Repository plugin) that let you store snapshots or persistent data in object storage. Swisscom likely offers an S3-compatible object storage service—you can push your Elasticsearch image to CF, configure the plugin on startup, and point it to your external storage bucket to keep data safe outside ephemeral containers.
  3. Switch to a Kubernetes-based service (if available)
    • If Swisscom offers managed Kubernetes, you can deploy Elasticsearch as a stateful set with persistent volume claims. This natively supports persistent storage and volume management, aligning perfectly with your need for durable data storage.

Final Note

While your Docker data container pattern works great in a raw Docker environment, it clashes with Cloud Foundry's orchestration model. Focus on the alternatives above to get reliable persistence for your Elasticsearch instance.

内容的提问来源于stack exchange,提问作者Aleksandar Nikolic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:28:43