@Test public void testNoAssembly() { BuildConfiguration buildConfig = new BuildConfiguration(); AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration(); DockerFileBuilder builder = assemblyManager.createDockerFileBuilder(buildConfig, assemblyConfig); String content = builder.content(); assertFalse(content.contains("COPY")); assertFalse(content.contains("VOLUME")); }
@SuppressWarnings("deprecation") DockerFileBuilder createDockerFileBuilder(BuildConfiguration buildConfig, AssemblyConfiguration assemblyConfig) { DockerFileBuilder builder = new DockerFileBuilder() .env(buildConfig.getEnv()) .labels(buildConfig.getLabels()) .expose(buildConfig.getPorts()) .run(buildConfig.getRunCmds()) .volumes(buildConfig.getVolumes()) .user(buildConfig.getUser()); if (buildConfig.getMaintainer() != null) { builder.maintainer(buildConfig.getMaintainer()); } if (buildConfig.getWorkdir() != null) { builder.workdir(buildConfig.getWorkdir()); } if (assemblyConfig != null) { builder.add(assemblyConfig.getName(), "") .basedir(assemblyConfig.getTargetDir()) .assemblyUser(assemblyConfig.getUser()) .exportTargetDir(assemblyConfig.exportTargetDir()); } else { builder.exportTargetDir(false); } builder.baseImage(buildConfig.getFrom()); if (buildConfig.getHealthCheck() != null) { builder.healthCheck(buildConfig.getHealthCheck()); } if (buildConfig.getCmd() != null){ builder.cmd(buildConfig.getCmd()); } else if (buildConfig.getCommand() != null) { Arguments args = Arguments.Builder.get().withShell(buildConfig.getCommand()).build(); builder.cmd(args); } if (buildConfig.getEntryPoint() != null){ builder.entryPoint(buildConfig.getEntryPoint()); } if (buildConfig.optimise()) { builder.optimise(); } return builder; }
DockerAssemblyManager { @SuppressWarnings("deprecation") DockerFileBuilder createDockerFileBuilder(BuildConfiguration buildConfig, AssemblyConfiguration assemblyConfig) { DockerFileBuilder builder = new DockerFileBuilder() .env(buildConfig.getEnv()) .labels(buildConfig.getLabels()) .expose(buildConfig.getPorts()) .run(buildConfig.getRunCmds()) .volumes(buildConfig.getVolumes()) .user(buildConfig.getUser()); if (buildConfig.getMaintainer() != null) { builder.maintainer(buildConfig.getMaintainer()); } if (buildConfig.getWorkdir() != null) { builder.workdir(buildConfig.getWorkdir()); } if (assemblyConfig != null) { builder.add(assemblyConfig.getName(), "") .basedir(assemblyConfig.getTargetDir()) .assemblyUser(assemblyConfig.getUser()) .exportTargetDir(assemblyConfig.exportTargetDir()); } else { builder.exportTargetDir(false); } builder.baseImage(buildConfig.getFrom()); if (buildConfig.getHealthCheck() != null) { builder.healthCheck(buildConfig.getHealthCheck()); } if (buildConfig.getCmd() != null){ builder.cmd(buildConfig.getCmd()); } else if (buildConfig.getCommand() != null) { Arguments args = Arguments.Builder.get().withShell(buildConfig.getCommand()).build(); builder.cmd(args); } if (buildConfig.getEntryPoint() != null){ builder.entryPoint(buildConfig.getEntryPoint()); } if (buildConfig.optimise()) { builder.optimise(); } return builder; } }
DockerAssemblyManager { @SuppressWarnings("deprecation") DockerFileBuilder createDockerFileBuilder(BuildConfiguration buildConfig, AssemblyConfiguration assemblyConfig) { DockerFileBuilder builder = new DockerFileBuilder() .env(buildConfig.getEnv()) .labels(buildConfig.getLabels()) .expose(buildConfig.getPorts()) .run(buildConfig.getRunCmds()) .volumes(buildConfig.getVolumes()) .user(buildConfig.getUser()); if (buildConfig.getMaintainer() != null) { builder.maintainer(buildConfig.getMaintainer()); } if (buildConfig.getWorkdir() != null) { builder.workdir(buildConfig.getWorkdir()); } if (assemblyConfig != null) { builder.add(assemblyConfig.getName(), "") .basedir(assemblyConfig.getTargetDir()) .assemblyUser(assemblyConfig.getUser()) .exportTargetDir(assemblyConfig.exportTargetDir()); } else { builder.exportTargetDir(false); } builder.baseImage(buildConfig.getFrom()); if (buildConfig.getHealthCheck() != null) { builder.healthCheck(buildConfig.getHealthCheck()); } if (buildConfig.getCmd() != null){ builder.cmd(buildConfig.getCmd()); } else if (buildConfig.getCommand() != null) { Arguments args = Arguments.Builder.get().withShell(buildConfig.getCommand()).build(); builder.cmd(args); } if (buildConfig.getEntryPoint() != null){ builder.entryPoint(buildConfig.getEntryPoint()); } if (buildConfig.optimise()) { builder.optimise(); } return builder; }  }
DockerAssemblyManager { @SuppressWarnings("deprecation") DockerFileBuilder createDockerFileBuilder(BuildConfiguration buildConfig, AssemblyConfiguration assemblyConfig) { DockerFileBuilder builder = new DockerFileBuilder() .env(buildConfig.getEnv()) .labels(buildConfig.getLabels()) .expose(buildConfig.getPorts()) .run(buildConfig.getRunCmds()) .volumes(buildConfig.getVolumes()) .user(buildConfig.getUser()); if (buildConfig.getMaintainer() != null) { builder.maintainer(buildConfig.getMaintainer()); } if (buildConfig.getWorkdir() != null) { builder.workdir(buildConfig.getWorkdir()); } if (assemblyConfig != null) { builder.add(assemblyConfig.getName(), "") .basedir(assemblyConfig.getTargetDir()) .assemblyUser(assemblyConfig.getUser()) .exportTargetDir(assemblyConfig.exportTargetDir()); } else { builder.exportTargetDir(false); } builder.baseImage(buildConfig.getFrom()); if (buildConfig.getHealthCheck() != null) { builder.healthCheck(buildConfig.getHealthCheck()); } if (buildConfig.getCmd() != null){ builder.cmd(buildConfig.getCmd()); } else if (buildConfig.getCommand() != null) { Arguments args = Arguments.Builder.get().withShell(buildConfig.getCommand()).build(); builder.cmd(args); } if (buildConfig.getEntryPoint() != null){ builder.entryPoint(buildConfig.getEntryPoint()); } if (buildConfig.optimise()) { builder.optimise(); } return builder; }  File createDockerTarArchive(String imageName, MavenBuildContext params, BuildConfiguration buildConfig, KitLogger log); File createDockerTarArchive(String imageName, final MavenBuildContext params, final BuildConfiguration buildConfig, KitLogger log, ArchiverCustomizer finalCustomizer); AssemblyFiles getAssemblyFiles(String name, BuildConfiguration buildConfig, MavenBuildContext mojoParams, KitLogger log); File createChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDirectory,
                                          String imageName, MavenBuildContext mojoParameters); }
DockerAssemblyManager { @SuppressWarnings("deprecation") DockerFileBuilder createDockerFileBuilder(BuildConfiguration buildConfig, AssemblyConfiguration assemblyConfig) { DockerFileBuilder builder = new DockerFileBuilder() .env(buildConfig.getEnv()) .labels(buildConfig.getLabels()) .expose(buildConfig.getPorts()) .run(buildConfig.getRunCmds()) .volumes(buildConfig.getVolumes()) .user(buildConfig.getUser()); if (buildConfig.getMaintainer() != null) { builder.maintainer(buildConfig.getMaintainer()); } if (buildConfig.getWorkdir() != null) { builder.workdir(buildConfig.getWorkdir()); } if (assemblyConfig != null) { builder.add(assemblyConfig.getName(), "") .basedir(assemblyConfig.getTargetDir()) .assemblyUser(assemblyConfig.getUser()) .exportTargetDir(assemblyConfig.exportTargetDir()); } else { builder.exportTargetDir(false); } builder.baseImage(buildConfig.getFrom()); if (buildConfig.getHealthCheck() != null) { builder.healthCheck(buildConfig.getHealthCheck()); } if (buildConfig.getCmd() != null){ builder.cmd(buildConfig.getCmd()); } else if (buildConfig.getCommand() != null) { Arguments args = Arguments.Builder.get().withShell(buildConfig.getCommand()).build(); builder.cmd(args); } if (buildConfig.getEntryPoint() != null){ builder.entryPoint(buildConfig.getEntryPoint()); } if (buildConfig.optimise()) { builder.optimise(); } return builder; }  File createDockerTarArchive(String imageName, MavenBuildContext params, BuildConfiguration buildConfig, KitLogger log); File createDockerTarArchive(String imageName, final MavenBuildContext params, final BuildConfiguration buildConfig, KitLogger log, ArchiverCustomizer finalCustomizer); AssemblyFiles getAssemblyFiles(String name, BuildConfiguration buildConfig, MavenBuildContext mojoParams, KitLogger log); File createChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDirectory,
                                          String imageName, MavenBuildContext mojoParameters); static final String DEFAULT_DATA_BASE_IMAGE; static final String SCRATCH_IMAGE; static final String DOCKER_IGNORE; static final String DOCKER_EXCLUDE; static final String DOCKER_INCLUDE; static final String DOCKERFILE_NAME; }