Skip to content

Commit b414b9b

Browse files
authored
chore: Some minor fixes (#1188)
1 parent 038f0df commit b414b9b

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

doc/changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
- Support docker SHELL setting for runCmds (#1157)
1313
- Added 'autoRemove' option for running containers (#1179)
1414
- Added support for AWS EC2 instance roles when pushing to AWS ECR (#1186)
15-
15+
- Add support for auto-pulling multiple base image for multi stage builds (#1057)
16+
1617
* **0.28.0** (2018-12-13)
1718
- Update to JMockit 1.43
1819
- Compiles with Java 11

src/main/asciidoc/inc/build/_overview.adoc

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,38 @@ The files of the assembly are stored in a build context relative directory `mave
2626
E.g. the files can be added with
2727

2828
.Example
29-
[source,dockerfils]
29+
[source,dockerfile]
3030
----
3131
COPY maven/ /my/target/directory
3232
----
3333

3434
so that the assembly files will end up in `/my/target/directory` within the container.
3535

3636
If this directory contains a `.maven-dockerignore` (or alternatively, a `.maven-dockerexclude` file), then it is used for excluding files for the build. Each line in this file is treated as a http://ant.apache.org/manual/Types/fileset.html[FileSet exclude pattern] as used by the http://maven.apache.org/plugins/maven-assembly-plugin[maven-assembly-plugin]. It is similar to `.dockerignore` when using Docker but has a slightly different syntax (hence the different name).
37+
<<ex-build-dockerexclude>> is an example which excludes all compiled Java classes.
3738

38-
If this directory contains a `.maven-dockerinclude` file, then it is used for including only those files for the build. Each line in this file is also treated as a http://ant.apache.org/manual/Types/fileset.html[FileSet exclude pattern] as used by the http://maven.apache.org/plugins/maven-assembly-plugin[maven-assembly-plugin].
39+
[[ex-build-dockerexclude]]
40+
.Example `.maven-dockerexclude` or `.maven-dockerignore`
41+
====
42+
[source]
43+
----
44+
target/classes/** # <1>
45+
----
46+
<1> Exclude all compiled classes
47+
====
48+
49+
50+
If this directory contains a `.maven-dockerinclude` file, then it is used for including only those files for the build. Each line in this file is also treated as a http://ant.apache.org/manual/Types/fileset.html[FileSet exclude pattern] as used by the http://maven.apache.org/plugins/maven-assembly-plugin[maven-assembly-plugin]. <<ex-build-dockerinclude>> shows how to include only jar file that have build to the Docker build context.
51+
52+
[[ex-build-dockerinclude]]
53+
.Example `.maven-dockerinclude`
54+
====
55+
[source]
56+
----
57+
target/*.jar # <1>
58+
----
59+
<1> Only add jar file to you Docker build context.
60+
====
3961

4062
Except for the <<build-assembly,assembly configuration>> all other configuration options are ignored for now.
4163

src/main/java/io/fabric8/maven/docker/util/DockerFileUtil.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@ public class DockerFileUtil {
4242

4343
private DockerFileUtil() {}
4444

45-
/**
46-
* Extract the base image from a dockerfile. The first line containing a <code>FROM</code> is
47-
* taken.
48-
*
49-
* @param dockerFile file from where to extract the base image
50-
* @param interpolator interpolator for replacing properties
51-
* @deprecated Use {@link DockerFileUtil#extractBaseImages} extractBaseImages instead
52-
*/
53-
@Deprecated
54-
public static String extractBaseImage(File dockerFile, FixedStringSearchInterpolator interpolator) throws IOException {
55-
List<String> result = extractBaseImages(dockerFile, interpolator);
56-
return result.isEmpty() ? null : result.iterator().next();
57-
}
58-
5945
/**
6046
* Extract the base images from a dockerfile. All lines containing a <code>FROM</code> is
6147
* taken.

src/test/java/io/fabric8/maven/docker/util/DockerFileUtilTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class DockerFileUtilTest {
4444
@Test
4545
public void testSimple() throws Exception {
4646
File toTest = copyToTempDir("Dockerfile_from_simple");
47-
assertEquals("fabric8/s2i-java", DockerFileUtil.extractBaseImage(
48-
toTest, FixedStringSearchInterpolator.create()));
47+
assertEquals("fabric8/s2i-java", DockerFileUtil.extractBaseImages(
48+
toTest, FixedStringSearchInterpolator.create()).get(0));
4949
}
5050

5151
@Test

0 commit comments

Comments
 (0)