Linux.
Use Debian. Most directions for Ubuntu will work fine, but you'll get patches a little faster. (Ubuntu gets them once Debian gets them. Mint gets them once Ubuntu gets them, etc. Follow the family tree
up.)
Install a base Linux install w/ KVM.
Create a VM in KVM. This is your NAS. Pass through or assign your drives to it (
you should be able to do this somehow, although if your hardware is incompatible with virtIO, you may need to replace a motherboard or CPU. I don't imagine you'll shy away from that.)
Your choice for a NAS OS may vary, but I would recommend another Linux install, mdadm to control the drives (RAID-6.), ext4 as a file system, and some fairly simple file sharing configuration. You definitely don't need a GUI for this, but webmin may be helpful. Any OS in a file server role will use pretty much all the RAM available as a file system cache, so MOAR RAMS IS BETTERS.
Or you can use ZFSonLinux, but I don't think the effort/benefit is there for your application. (I
would use ZFS on a file server with a crapton of RAM, that hosted a lot of shares, a lot of clients, etc. But in most home-use cases, ZFS is using an AA gun to swat a mosquito.)
I would avoid FreeBSD or FreeBSD-based distros like FreeNAS just because BSD is not Linux but it's really damn similar and I get confused easily.
Create another VM to be your Docker host environment if you really want to mess around with Docker containers. They have their pros and cons.