Version 3.2 has an incompatibility with docker cloud: it cannot resolve services, due to a resolv.conf issue. Latest version seems to work fine.
Lightweight ready-to use OpenCV image
$ docker run --rm -it -v $(pwd):/source schickling/opencv
$ g++ $(pkg-config --cflags --libs opencv) my-file.cpp