small, multi-platform (amd64, arm64) images

Modify zookeeper docker container image due to arm64 compatibility

Issue-ID: INT-911
Issue-ID: INT-934
Signed-off-by: Simon Hrabos <simon.hrabos@tieto.com>
Change-Id: I765897a46824c232c1cdde88be86404c0571ae46
diff --git a/pom.xml b/pom.xml
index 8ad6cfa..70365bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,106 +104,20 @@
 					<skip />
 				</configuration>
 			</plugin>
-			<plugin>
-				<groupId>com.spotify</groupId>
-				<artifactId>docker-maven-plugin</artifactId>
-				<version>1.0.0</version>
-				<configuration>
-					<imageName>onap/dmaap/zookeeper</imageName>
-					<dockerDirectory>src/main/docker</dockerDirectory>
-					<serverId>docker-hub</serverId>
-					<imageTags>
-						<imageTag>${dockertag1}</imageTag>
-						<imageTag>${dockertag2}</imageTag>
-					</imageTags>
-					<forceTags>true</forceTags>
-					<resources>
-						<!-- <resource> <targetPath>/</targetPath> <directory>${dockerLocation}</directory> 
-							<include>${project.build.finalName}.jar</include> </resource> -->
-						<resource>
-							<targetPath>/</targetPath>
-							<directory>${project.build.directory}</directory>
-							<include>**/**</include>
-						</resource>
-					</resources>
-				</configuration>
-				<executions>
-					<execution>
-						<id>build-image</id>
-						<phase>install</phase>
-						<goals>
-							<goal>build</goal>
-						</goals>
-						<configuration>
-							<skipDockerBuild>${skip.docker.build}</skipDockerBuild>
-						</configuration>
-					</execution>
-
-					<execution>
-						<id>tag-image-project-version</id>
-						<phase>install</phase>
-						<goals>
-							<goal>tag</goal>
-						</goals>
-						<configuration>
-							<image>onap/dmaap/zookeeper</image>
-							<newName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag2}</newName>
-							<skipDockerTag>${skip.docker.push}</skipDockerTag>
-						</configuration>
-					</execution>
-
-					<execution>
-						<id>tag-image-latest</id>
-						<phase>install</phase>
-						<goals>
-							<goal>tag</goal>
-						</goals>
-						<configuration>
-							<image>onap/dmaap/zookeeper</image>
-							<newName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag1}</newName>
-							<skipDockerTag>${skip.docker.push}</skipDockerTag>
-						</configuration>
-					</execution>
-
-					<execution>
-						<id>push-image</id>
-						<phase>deploy</phase>
-						<goals>
-							<goal>push</goal>
-						</goals>
-						<configuration>
-							<imageName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag2}</imageName>
-							<skipDockerPush>${skip.docker.push}</skipDockerPush>
-						</configuration>
-					</execution>
-
-					<execution>
-						<id>push-image-latest</id>
-						<phase>deploy</phase>
-						<goals>
-							<goal>push</goal>
-						</goals>
-						<configuration>
-							<imageName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag1}</imageName>
-							<skipDockerPush>${skip.docker.push}</skipDockerPush>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-
 		</plugins>
 	</build>
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<timestamp>${maven.build.timestamp}</timestamp>
-        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+    <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
 		<sitePath>/content/sites/site/org/onap/dmaap/zookeeper/${project.artifactId}/${project.version}</sitePath>
 		<skip.docker.build>true</skip.docker.build>
 		<skip.docker.push>true</skip.docker.push>
 		<nexusproxy>https://nexus.onap.org</nexusproxy>
 		<docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
 		<onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+    <zookeeper.dist.version>3.4.13</zookeeper.dist.version>
 	</properties>
 
 	<!-- Distribution management -->
@@ -247,7 +161,7 @@
                                         project.properties['dockertag1']=project.properties['ver'] + "-latest";
                                         project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
                                         } else {
-                                        project.properties['dockertag1']=project.properties['ver']+ "-STAGING-latest";
+                                        project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
                                         project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
                                         }
                                         println 'docker tag 1: ' + project.properties['dockertag1'];
@@ -257,6 +171,46 @@
                             </execution>
                         </executions>
                     </plugin>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <version>0.28.0</version>  
+                        <configuration>
+                            <verbose>${docker.verbose}</verbose>
+                            <apiVersion>${docker.apiVersion}</apiVersion>
+                            <pullRegistry>${docker.pull.registry}</pullRegistry>
+                            <pushRegistry>${docker.push.registry}</pushRegistry>
+                            <images>
+                                <image>                            
+                                    <name>onap/dmaap/zookeeper</name>
+                                    <build>
+                                        <cleanup>try</cleanup>
+                                        <dockerFile>Dockerfile</dockerFile>
+                                        <tags>
+                                            <tag>${dockertag1}</tag>
+                                            <tag>${dockertag2}</tag>
+                                        </tags>
+                                    </build>
+                                </image>
+                            </images>
+                        </configuration>
+                         <executions>
+                             <execution>
+                                 <id>generate-images</id>
+                                 <phase>install</phase>
+                                 <goals>
+                                     <goal>build</goal>
+                                 </goals>
+                             </execution>
+                             <execution>
+                                 <id>push-images</id>
+                                 <phase>deploy</phase>
+                                 <goals>
+                                     <goal>push</goal>
+                                 </goals>
+                             </execution>
+                         </executions>
+                    </plugin>
                     </plugins>
                     </build>
 		</profile>