Testing hardware interfaces with Docker

I was working on a new software project using NodeJS. This particular project was specific to ripping discs and encoding video. I'd spend a lot of time building a large docker image (800MB) and transferring that - on every build(!) - to an actual, physical server that had a DVD/Blu-Ray drive attached to it.
I had thought this would be necessary. How else was I going to test that my disc ripping was working properly?

After a while of this, it dawned on me that I could create an ISO of this disc, and use it with a VirtualBox VM. That would simulate the same hardware device, and I could be reasonably sure that my app would work when it tested against this. That really wasn't bad. I could have a long running VM with my working directory bind-mounted in the VM, so the development iteration cycle was still quick.

After a while of this, it dawned on me that: "heck, I could just volume mount that same ISO on a docker container!". Sure enough, I tested it out:

docker run --rm -it -v ~/Documents/mymovie.iso:/dev/sr0 ubuntu:16.04

BOOM!

It actually worked. First try.
No more need for physical hardware on a development workstation! Thats a big win!

It drops the iteration time even further. And, after a bit of googling, noticed that it also helps contain the development tools needed (like a different version of NodeJS that I need for a different project). Yes, you could certainly use nvm or n for this part.