Skip to content

Using docker-maven-plugin copy goal to extract files from builder image #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1e04155
Using Docker Maven Plugin to extract tarball from builder container
mabrarov Oct 21, 2020
adebd30
Usage of copy goal of Maven Docker Plugin
mabrarov Oct 24, 2020
66ae4ed
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Oct 27, 2020
fd3c878
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Oct 27, 2020
c76d6e1
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Oct 28, 2020
e63aacf
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Oct 28, 2020
443a837
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Oct 29, 2020
f7ace1d
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Oct 29, 2020
7a5a020
Updated to match changes in copy goal of Docker Maven Plugin
mabrarov Nov 5, 2020
d29393a
Optimization of builder image
mabrarov Nov 6, 2020
77c88f7
Reproducible artifact produced by builder image.
mabrarov Nov 6, 2020
1f770a8
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Nov 10, 2020
0299de2
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Nov 10, 2020
ed55262
Adopted Travis CI for custom version of docker-maven-plugin
mabrarov Nov 10, 2020
46b9bec
Enhancement of Travis CI test script
mabrarov Nov 10, 2020
b876db0
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Nov 10, 2020
6d63519
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Nov 10, 2020
907ae07
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Nov 10, 2020
246f091
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Nov 10, 2020
de17619
Optimization of Travis CI test script
mabrarov Nov 10, 2020
75a5334
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Nov 10, 2020
373d9ef
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Nov 10, 2020
56a9eae
Optimization of Travis CI test script
mabrarov Nov 10, 2020
fd58329
Merge branch 'master' into feature/docker-maven-plugin_app_tar
mabrarov Nov 10, 2020
bbf04ef
Merge branch 'feature/docker-maven-plugin_app_tar' into feature/docke…
mabrarov Nov 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
- BOOST_SHA256: '8211e639fd443cbffed7891af9c54012848d04df340ee993bedb3ef0346347c3'
- DOCKERHUB_USER: 'abrarov'
- MAVEN_WRAPPER: '0'
- DOCKER_MAVEN_PLUGIN_VERSION: '0.34-dev'

matrix:
include:
Expand Down
41 changes: 18 additions & 23 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<packaging>pom</packaging>

<properties>
<artifact.file>${project.build.directory}/app.tar.gz</artifact.file>
<artifact.file>${project.build.directory}/${builder.output.fileName}</artifact.file>
</properties>

<dependencies>
Expand All @@ -26,35 +26,30 @@
<build>
<plugins>
<plugin>
<!--
There is no way to copy file from image, i.e. to

1. create temporary non-running container
2. copy file from that container
3. remove temporary container

with io.fabric8:docker-maven-plugin plugin at the moment.
Refer to https://github.com/fabric8io/docker-maven-plugin/issues/752.
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>copy-from-image</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
<goal>copy</goal>
</goals>
<configuration>
<target>
<exec executable="docker" failonerror="true">
<arg value="run"/>
<arg value="--rm"/>
<arg value="${builder.image.repository}:${project.version}"/>
<redirector output="${artifact.file}" logError="true" binaryOutput="true"
createemptyfiles="false"/>
</exec>
</target>
<images>
<image>
<name>${builder.image.repository}:${project.version}</name>
<copy>
<entries>
<entry>
<containerPath>${builder.output.file}</containerPath>
<hostDirectory>${project.build.directory}</hostDirectory>
</entry>
</entries>
</copy>
</image>
</images>
<createContainers>true</createContainers>
</configuration>
</execution>
</executions>
Expand Down
9 changes: 2 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<git-commit-id-plugin.version>4.0.2</git-commit-id-plugin.version>
<build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
<maven-antrun-plugin.version>3.0.0</maven-antrun-plugin.version>
<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<download-maven-plugin.version>1.6.0</download-maven-plugin.version>
Expand All @@ -47,7 +46,8 @@

<docker.image.registry>abrarov</docker.image.registry>
<builder.image.repository>${docker.image.registry}/maven-docker-builder-builder</builder.image.repository>
<builder.output.file>/out.tar.gz</builder.output.file>
<builder.output.fileName>out.tar.gz</builder.output.fileName>
<builder.output.file>/${builder.output.fileName}</builder.output.file>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -99,11 +99,6 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions travis/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-mabrarov-maven</id>
<name>bintray</name>
<url>https://dl.bintray.com/mabrarov/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-mabrarov-maven</id>
<name>bintray-plugins</name>
<url>https://dl.bintray.com/mabrarov/maven</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
</settings>