First, save the run.cpp file somewhere.
$ docker run -it \
-v <your-entwine-data-directory>:/opt/data/ \
-v <wherever-you-put-that-c++-file>:/opt/test/ \
--entrypoint=bash connormanning/entwine
root@ff99e5b49bf0:/# cd /opt/test/
root@ff99e5b49bf0:/opt/test# g++ -std=c++11 -I /usr/include/jsoncpp/ run.cpp -lentwine -ljsoncpp -o dump