1#!/usr/bin/env bash
2if [ "$#" -ne 1 ]
3then
4  echo "Usage: docker-run.sh <JDK number> (number can be 6, 7, 8)"
5  exit 1
6fi
7
8docker run --rm -it               \
9    -u `id -u`:`id -g`            \
10    -v `pwd`:/work                \
11    -v ~:/my-home                 \
12    -e "HOME=/my-home"            \
13    -w /work                      \
14    maven:3-jdk-$1                \
15    mvn -Dmaven.repo.local=/my-home/.m2/repository clean test
16
17