protected void buildImage(
      DockerAccess dockerAccess, String imageName, ImageConfiguration imageConfig)
      throws DockerAccessException, MojoExecutionException {
    warnIfDeprecatedCommandConfigIsUsed(imageConfig.getBuildConfiguration());

    autoPullBaseImage(dockerAccess, imageConfig);

    MojoParameters params = createMojoParameters();
    File dockerArchive =
        dockerAssemblyManager.createDockerTarArchive(
            imageName, params, imageConfig.getBuildConfiguration());

    dockerAccess.buildImage(imageName, dockerArchive);
    log.info(imageConfig.getDescription() + ": Build image ");
  }
 private String getPrefix(ImageConfiguration config) {
   Map<String, String> refConfig = config.getExternalConfig();
   String prefix = refConfig != null ? refConfig.get("prefix") : null;
   if (prefix == null) {
     prefix = "docker";
   }
   return prefix;
 }
 private void autoPullBaseImage(DockerAccess dockerAccess, ImageConfiguration imageConfig)
     throws DockerAccessException, MojoExecutionException {
   BuildImageConfiguration buildConfig = imageConfig.getBuildConfiguration();
   String fromImage = buildConfig.getFrom();
   if (fromImage == null) {
     AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
     if (assemblyConfig == null || assemblyConfig.getDockerFileDir() == null) {
       fromImage = DockerAssemblyManager.DEFAULT_DATA_BASE_IMAGE;
     }
   }
   if (fromImage != null) {
     checkImageWithAutoPull(dockerAccess, fromImage, new ImageName(fromImage).getRegistry(), true);
   }
 }
  @Override
  public List<ImageConfiguration> resolve(ImageConfiguration config, Properties properties)
      throws IllegalArgumentException {
    String prefix = getPrefix(config);

    RunImageConfiguration run = extractRunConfiguration(prefix, properties);
    BuildImageConfiguration build = extractBuildConfiguration(prefix, properties);
    WatchImageConfiguration watch = extractWatchConfig(prefix, properties);

    String name = extractName(prefix, properties);
    String alias = withPrefix(prefix, ALIAS, properties);

    return Collections.singletonList(
        new ImageConfiguration.Builder()
            .name(name)
            .alias(alias != null ? alias : config.getAlias())
            .runConfig(run)
            .buildConfig(build)
            .watchConfig(watch)
            .build());
  }