Containerize Candidate Code

We're hiring. We ask candidates to write some code before we talk to them. Which means we have to run other people's code on our laptops. Natural incentives should discourage a job hunter from attacking a potential employer. But I don't trust incentives. So I've taken to running their code in docker. You can too.

cd ~/Downloads/candidates-code docker pull openjdk:8-alpine docker run \ -v "$PWD:/usr/src/app" \ -w /usr/src/app \ -p 8080:8080 \ -it openjdk:8-alpine sh docker pull maven:3.6-jdk-8-alpine docker run \ -v "$PWD:/usr/src/app" \ -w /usr/src/app \ -p 8080:8080 \ -it maven:3.6-jdk-8-alpine sh

In this example our candidate submitted their code in Java. Their `README` indicated java 8+ as a requirement... so I pulled that version of image. I run the container mounting the local directory and opening a port which was also mentioned in the `README`.

Their code came with tests, so I also used a maven container to be able to run those tests.

Another candidate had submitted a javascript implementation. You'll see I use basically the same trick with different port and different path inside the container. I look at the docs for the off-the-shelf containers to figure out the best place to mount the code under review.

docker pull node:10.9-alpine docker run \ -v "$PWD:/home/node" \ -w /home/node \ -p 3000:3000 \ -it node:10.9-alpine sh