Skip to content

Commit

Permalink
chore: Some minor fixes (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuss authored Apr 6, 2019
1 parent 038f0df commit b414b9b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
3 changes: 2 additions & 1 deletion doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
- Support docker SHELL setting for runCmds (#1157)
- Added 'autoRemove' option for running containers (#1179)
- Added support for AWS EC2 instance roles when pushing to AWS ECR (#1186)

- Add support for auto-pulling multiple base image for multi stage builds (#1057)

* **0.28.0** (2018-12-13)
- Update to JMockit 1.43
- Compiles with Java 11
Expand Down
26 changes: 24 additions & 2 deletions src/main/asciidoc/inc/build/_overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,38 @@ The files of the assembly are stored in a build context relative directory `mave
E.g. the files can be added with

.Example
[source,dockerfils]
[source,dockerfile]
----
COPY maven/ /my/target/directory
----

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

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).
<<ex-build-dockerexclude>> is an example which excludes all compiled Java classes.

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-dockerexclude]]
.Example `.maven-dockerexclude` or `.maven-dockerignore`
====
[source]
----
target/classes/** # <1>
----
<1> Exclude all compiled classes
====


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.

[[ex-build-dockerinclude]]
.Example `.maven-dockerinclude`
====
[source]
----
target/*.jar # <1>
----
<1> Only add jar file to you Docker build context.
====

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

Expand Down
14 changes: 0 additions & 14 deletions src/main/java/io/fabric8/maven/docker/util/DockerFileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,6 @@ public class DockerFileUtil {

private DockerFileUtil() {}

/**
* Extract the base image from a dockerfile. The first line containing a <code>FROM</code> is
* taken.
*
* @param dockerFile file from where to extract the base image
* @param interpolator interpolator for replacing properties
* @deprecated Use {@link DockerFileUtil#extractBaseImages} extractBaseImages instead
*/
@Deprecated
public static String extractBaseImage(File dockerFile, FixedStringSearchInterpolator interpolator) throws IOException {
List<String> result = extractBaseImages(dockerFile, interpolator);
return result.isEmpty() ? null : result.iterator().next();
}

/**
* Extract the base images from a dockerfile. All lines containing a <code>FROM</code> is
* taken.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class DockerFileUtilTest {
@Test
public void testSimple() throws Exception {
File toTest = copyToTempDir("Dockerfile_from_simple");
assertEquals("fabric8/s2i-java", DockerFileUtil.extractBaseImage(
toTest, FixedStringSearchInterpolator.create()));
assertEquals("fabric8/s2i-java", DockerFileUtil.extractBaseImages(
toTest, FixedStringSearchInterpolator.create()).get(0));
}

@Test
Expand Down

0 comments on commit b414b9b

Please sign in to comment.