Skip to content

Instantly share code, notes, and snippets.

@rhuss
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhuss/21ace7e6581079e2468c to your computer and use it in GitHub Desktop.
Save rhuss/21ace7e6581079e2468c to your computer and use it in GitHub Desktop.
docker-maven-plugin configuration Samples
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<image>
<id>tomcat</id>
<name>consol/tomcat-7.0</name>
<run>
<volumesFrom>data</volumesFrom>
<env>
<CATALINA_OPTS>-Xmx32m</CATALINA_OPTS>
</env>
<ports>
<port>jolokia.port:8080</port>
</ports>
<waitHttp>http://localhost:${jolokia.port}/jolokia</waitHttp>
<wait>10000</wait>
</run>
</image>
<image>
<id>data</id>
<name>jolokia/docker-jolokia-demo</name>
<build>
<assemblyDescriptor>src/main/docker-assembly.xml</assemblyDescriptor>
</build>
</image>
</configuration>
</plugin>
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<image>
<id>micro-service</id>
<name>jolokia/${project.artifactId}:${project.version}</name>
<build>
<baseImage>java</baseImage>
<assemblyDescriptor>src/main/docker-assembly.xml</assemblyDescriptor>
<command>java -Djava.security.egd=file:/dev/./urandom -jar /maven/tomcat-jolokia.jar</command>
</build>
<run>
<ports>
<port>tomcat.port:8080</port>
</ports>
<waitHttp>http://localhost:${tomcat.port}/jolokia</waitHttp>
<wait>10000</wait>
<links>
<link>mongo:db</link>
</links>
</run>
</image>
<image>
<id>mongo</id>
<name>mongo</name>
<run/>
</image>
</configuration>
</plugin>
@rossbachp
Copy link

Good examples! How you deploy the mongo:db images with this setup?

@rhuss
Copy link
Author

rhuss commented Sep 8, 2014

"mongo" is a complete image pulled from an registry (and hence already deployed). In practice you probably wont use a vanilla 'mongo' image but build one using this as a BASE. So you would need a "" configuration section here as well. This image can then be deployed as the other built images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment