How to add or mount directory in LXD (Linux container)

Originally published at:

I have two LXD containers running. One is for Nginx, and another is for processing data. I need to share data between two containers. How do I add or mount a shared directory between two?

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki