machine:
  services:
    - docker
  java:
    version: oraclejdk8

dependencies:
  cache_directories:
    - "~/docker"
  override:
    - mvn install
    - docker info
    - if [[ -e ~/docker/image.tar ]]; then docker load --input ~/docker/image.tar; fi
    - docker build -t atomfrede/turbo-adventure .
    - mkdir -p ~/docker; docker save atomfrede/turbo-adventure > ~/docker/image.tar
machine:
  services:
    - docker
  java:
    version: oraclejdk8

test:
  cache_directories:
    - "~/docker"
  override:
    - mvn install
    - docker info
    - if [[ -e ~/docker/image.tar ]]; then docker load --input ~/docker/image.tar; fi
    - docker build -t atomfrede/turbo-adventure .
    - mkdir -p ~/docker; docker save atomfrede/turbo-adventure > ~/docker/image.tar

Build docke image in test phase
Build docke image in test phase
