How to setup Nvidia HW acceleration in Ubuntu Docker?

One caveat everyone here should be aware of is the lack of decode support. Only encoding currently works with Plex Transcoder. Vote for that to change here: Hardware Accelerated Decode (Nvidia) for Linux