private void validateParameters() throws MojoExecutionException {
    if (dockerDirectory == null) {
      if (baseImage == null) {
        throw new MojoExecutionException("Must specify baseImage if dockerDirectory is null");
      }
    } else {
      if (baseImage != null) {
        getLog().warn("Ignoring baseImage because dockerDirectory is set");
      }
      if (maintainer != null) {
        getLog().warn("Ignoring maintainer because dockerDirectory is set");
      }
      if (entryPoint != null) {
        getLog().warn("Ignoring entryPoint because dockerDirectory is set");
      }
      if (cmd != null) {
        getLog().warn("Ignoring cmd because dockerDirectory is set");
      }
      if (runList != null && !runList.isEmpty()) {
        getLog().warn("Ignoring run because dockerDirectory is set");
      }
      if (workdir != null) {
        getLog().warn("Ignoring workdir because dockerDirectory is set");
      }
      if (user != null) {
        getLog().warn("Ignoring user because dockerDirectory is set");
      }
    }
  }
Set the networking mode for the RUN instructions during build
src/main/java/com/spotify/docker/BuildMojo.java