diff options
author | Prudence Au <prudence.au@amdocs.com> | 2018-08-09 20:28:12 -0400 |
---|---|---|
committer | Prudence Au <prudence.au@amdocs.com> | 2018-08-09 21:37:59 -0400 |
commit | ad8bfe6246315f62bc17e6f4d9cf0d65cf3ef9bc (patch) | |
tree | 69d62ea90ce37f0df4909754fa3ce3bb479a73c4 | |
parent | 530c27683d89214372a33b844e4606517b5ce8d4 (diff) |
Create Docker Image
Change-Id: I94f5b534eb75f2dfaeecb52bd36931926f0923cf
Issue-ID: LOG-519
Signed-off-by: Prudence Au <prudence.au@amdocs.com>
-rw-r--r-- | pom.xml | 76 | ||||
-rw-r--r-- | src/main/docker/Dockerfile | 12 |
2 files changed, 80 insertions, 8 deletions
@@ -19,6 +19,11 @@ <java.version>1.8</java.version> <dmaap.client.version>1.1.5</dmaap.client.version> <aai.rest.client.version>1.2.1</aai.rest.client.version> + <!--docker--> + <docker.tag>${project.version}-${timestamp}</docker.tag> + <docker.latest.tag>${project.version}-latest</docker.latest.tag> + <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry> + <docker.push.registry>nexus3.onap.org:10003</docker.push.registry> </properties> <dependencyManagement> @@ -149,7 +154,7 @@ </execution> </executions> </plugin> - <plugin> + <!--<plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.4.11</version> @@ -170,7 +175,7 @@ </imageTags> <forceTags>true</forceTags> </configuration> - </plugin> + </plugin>--> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> @@ -195,4 +200,71 @@ </resource> </resources> </build> + + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.19.1</version> + <configuration> + <verbose>true</verbose> + <apiVersion>1.23</apiVersion> + <pullRegistry>${docker.pull.registry}</pullRegistry> + <pushRegistry>${docker.push.registry}</pushRegistry> + <dockerHost>${docker.pull.registry}</dockerHost> + <images> + <image> + <name>onap/${project.artifactId}</name> + <alias>${project.artifactId}</alias> + <build> + <cleanup>true</cleanup> + <tags> + <tag>${docker.snapshot.tag}</tag> + <tag>${docker.latest.tag}</tag> + </tags> + <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir> + </build> + </image> + </images> + </configuration> + <executions> + <execution> + <id>clean-images</id> + <phase>pre-clean</phase> + <goals> + <goal>remove</goal> + </goals> + <configuration> + <removeAll>true</removeAll> + </configuration> + </execution> + + <execution> + <id>generate-images</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>push-images</id> + <phase>deploy</phase> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + <configuration> + <image>onap/vvp/cms</image> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project>
\ No newline at end of file diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 0cdd1cf..a764fbf 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -8,12 +8,12 @@ RUN mkdir -p $MICROSERVICE_HOME/config/ RUN mkdir -p $MICROSERVICE_HOME/lib/ RUN mkdir -p $MICROSERVICE_HOME/bin/ -ADD target/pomba-context-aggregator.jar $MICROSERVICE_HOME/lib/ -COPY config/ $MICROSERVICE_HOME/config/ -ADD target/startService.sh $MICROSERVICE_HOME/bin/ +#ADD ./target/pomba-context-aggregator.jar $MICROSERVICE_HOME/lib/ +#COPY ./config/ $MICROSERVICE_HOME/config/ +#ADD ./target/startService.sh $MICROSERVICE_HOME/bin/ -RUN chmod 755 $MICROSERVICE_HOME/config/* -RUN chmod 755 $MICROSERVICE_HOME/lib/* -RUN chmod 755 $MICROSERVICE_HOME/bin/* +#RUN chmod 755 $MICROSERVICE_HOME/config/* +#RUN chmod 755 $MICROSERVICE_HOME/lib/* +#RUN chmod 755 $MICROSERVICE_HOME/bin/* CMD ["/opt/app/bin/startServer.sh"] |