cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating jaxrs/spring_boot pom to support Docker
Date Tue, 15 Aug 2017 17:01:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 23c419318 -> 473105a03


Updating jaxrs/spring_boot pom to support Docker


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/473105a0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/473105a0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/473105a0

Branch: refs/heads/3.1.x-fixes
Commit: 473105a03eed95de37b5ecc8a67a6335b451d0ad
Parents: 23c4193
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Aug 15 17:58:11 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Aug 15 18:00:41 2017 +0100

----------------------------------------------------------------------
 .../samples/jax_rs/spring_boot/Dockerfile       |  5 +++
 .../release/samples/jax_rs/spring_boot/README   | 46 ++++++++++++++++----
 .../release/samples/jax_rs/spring_boot/pom.xml  | 19 ++++++++
 3 files changed, 61 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/473105a0/distribution/src/main/release/samples/jax_rs/spring_boot/Dockerfile
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot/Dockerfile b/distribution/src/main/release/samples/jax_rs/spring_boot/Dockerfile
new file mode 100644
index 0000000..57ef253
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot/Dockerfile
@@ -0,0 +1,5 @@
+FROM openjdk:8-jdk-alpine
+VOLUME /tmp
+ADD target/spring-boot-sample-rs-cxf.jar app.jar
+ENV JAVA_OPTS=""
+ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar"
]

http://git-wip-us.apache.org/repos/asf/cxf/blob/473105a0/distribution/src/main/release/samples/jax_rs/spring_boot/README
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot/README b/distribution/src/main/release/samples/jax_rs/spring_boot/README
index c97cbef..4d107b1 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot/README
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot/README
@@ -3,15 +3,40 @@
 This sample project demonstrates how to use CXF JAX-RS services
 with Spring Boot. This demo has two JAX-RS class resources being deployed in a single JAX-RS
endpoint.  
 
-The sample uses Maven. It can be built and run from the command line:
+= Starting the server =
+
+The sample uses Maven. It can be built and run from the command line using Maven, Java or
Docker:
+
+---- With Maven ----
 
-----
 $ mvn -Pserver
-----
-or
-----
+
+---- With Java ----
+
 $ java -jar target/spring-boot-sample-rs-cxf.jar
-----
+
+---- With Docker ----
+
+Install Docker, create the demo image:
+--
+$ mvn dockerfile:build
+--
+
+Optional step, push the image. 
+Create a DockerHub id, for example, make this id set to your current ${username}
+--
+$ docker login
+$ mvn dockerfile:push
+--
+
+Run the container:
+--
+docker run -p 8080:8080 -t ${username}/apachecxf:spring-boot-sample-rs-cxf
+--
+
+== Testing the server ==
+
+---- From the browser ----
 
 http://localhost:8080/services/helloservice/sayHello/ApacheCxfUser
 
@@ -34,8 +59,11 @@ or access it from the CXF Services page:
   http://localhost:8080/services/helloservice/services
   and follow a Swagger link.
 
-To run the client from a command line open a new terminal window and run:
 
-----
+---- From the command line ----
+
+--
 $ mvn -Pclient
-----
\ No newline at end of file
+--
+
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/473105a0/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml
index 17e8151..4b63e0b 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml
@@ -7,6 +7,7 @@
         <version>3.1.13-SNAPSHOT</version>
         <relativePath>../..</relativePath>
     </parent>
+    <groupId>org.apache.cxf.samples</groupId> 
     <artifactId>spring-boot-sample-rs-cxf</artifactId>
     <name>Spring Boot CXF REST Application</name>
     <description>Spring Boot CXF REST Application</description>
@@ -62,6 +63,24 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+              <groupId>com.spotify</groupId>
+              <artifactId>dockerfile-maven-plugin</artifactId>
+              <version>1.3.4</version>
+              <executions>
+               <execution>
+                <id>default</id>
+                <goals>
+                  <goal>build</goal>
+                  <goal>push</goal>
+                </goals>
+               </execution>
+              </executions>
+              <configuration>
+                <repository>${user.name}/apachecxf</repository>
+                <tag>${project.artifactId}</tag>
+              </configuration>
+            </plugin>
         </plugins>
     </build>
     <profiles>


Mime
View raw message