-RUN bash /playpen/bin/build_dev_env.sh
-RUN cd /playpen/src/; make -B mc_listener sender pipe_reader
+RUN cd /playpen/listener/src \
+ && make -B all \
+ && ls -al mc_listener \
+ && cp mc_listener sender pipe_reader rdc_replay rdc_extract /playpen/bin/
+
+# Run unit tests. If they don't pass the build fails here. Tests can be run from src, but expect binaries in bin
+# so that they can be run in the final image as well.
+#
+ENV PATH /playpen/bin:/playpen/listener/src:$PATH
+RUN cd /playpen/listener/test \
+ && ./run_unit_test.ksh
+
+RUN cd /playpen/listener/src \
+ && /playpen/listener/src/verify.sh \
+ && /playpen/listener/src/verify_replay.sh
+