Hi,
when you have made/built your tomee container you should have a look at
jolokia docker plugin and properties-maven-plugin.

Basically you would do something like this (maven, BTW):

 <plugin>
                <groupId>org.jolokia</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.13.6</version>
                <configuration>
                    <images>
                        <image>
                            <registry>{private registry if
available}</registry>
                            <alias>{your app finalname}</alias>
                            <name>{your docker image}</name>
                            <build>
                                <from>{the dependent tomee image}</from>
                                <assembly>
                                    <descriptor>assembly.xml</descriptor>
                                   
<basedir>/usr/local/tomee/webapps/</basedir>
                                </assembly>
                                <tags>
                                    <tag>${docker.tag}</tag>
                                </tags>
                                <ports>
                                    <port>${run.port}</port>
                                </ports>
                                <env>
                                   
<CATALINA_OPTS>${my_catalina_opts}</CATALINA_OPTS>
                                </env>
                            </build>
                            <run>
                                <ports>
                                    <port>${run.port}:${run.port}</port>
                                </ports>
                            </run>
                        </image>
                    </images>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0-alpha-2</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <id>read-project-properties</id>
                    </execution>
                </executions>
                <configuration>
                    <files>
                       
<file>${project.basedir}/src/main/docker/environment.properties</file>
                    </files>
                </configuration>
            </plugin>


assembly:

<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>true</useProjectArtifact>
            <includes>
                <include>{your app artifact}</include>
            </includes>
            <outputDirectory>.</outputDirectory>
            <outputFileNameMapping>{your app}.war</outputFileNameMapping>
        </dependencySet>
    </dependencySets>
</assembly>

environment.properties

my_catalina_opts= -D<whatever>...

So mvn clean package docker:build
(mvn docker:push for uploading to registry)

If you use generic names for all properties it's easy to build an app which
you can deploy in lab/prod/whatever just by changing docker links (and env
vars)

cheers,

hw





--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/INSTALL-TOMEE-with-docker-tp4677016p4677019.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to