graywolf
graywolf

Reputation: 7510

Is it safe to use same host volume in multiple containers?

Can I safely use same named data volume from multiple containers at the same time? Meaning, can I do following:

docker run -v data_disk:/data base/archlinux
docker run -v data_disk:/data ubuntu

without fear of data corruption?

Upvotes: 1

Views: 1354

Answers (1)

DAXaholic
DAXaholic

Reputation: 35358

As always - it depends :)
In this case on the application as mentioned in the docs

Multiple containers can also share one or more data volumes. However, multiple containers writing to a single shared volume can cause data corruption. Make sure your applications are designed to write to shared data stores.

Upvotes: 2

Related Questions