By sethb
Considering a move to DO for a project I’m working on, and was wondering what the recommended way is to share storage between multiple docker containers…
From what I’ve read, Block Storage can only be mounted on one droplet at a time. Would it be wise to mount to a droplet, then share that via NFS? Has anyone done this without major negative performance consequences?
Is there another way people might recommend sharing storage space across docker app volumes?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
There are three approaches to this. One is as you mentioned to attach block storage to one container and then export it via NFS. However, this will require configuration on your part and management as well as ensuring that the NFS connection doesn’t break.
Alternatively, you can look at what your storage needs are and break them out by usage. For databases you would be better off using a separate droplet to manage your DB or our managed DB service.
And for static assets you can use Spaces Object Storage. This allows the containers to be more stateless and easier to replace, as well as ensuring consistency of data because distinct systems are handling your storage needs. It also makes everything more scalable immediately as you are using a pre-defined service for the specific function it was intended for.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.