Skip to content

Commit

Permalink
Switch to Jib to create Docker image that works with Coherence Operat…
Browse files Browse the repository at this point in the history
…or 3.x
  • Loading branch information
aseovic committed Jan 27, 2021
1 parent ce4919e commit 2e787d8
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 38 deletions.
33 changes: 0 additions & 33 deletions bobs-books/roberts-books/roberts-coherence/Dockerfile

This file was deleted.

4 changes: 1 addition & 3 deletions bobs-books/roberts-books/roberts-coherence/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

TAG=${1:-test}

mvn clean install
docker build -t ghcr.io/verrazzano/example-roberts-coherence:${TAG} .
mvn package -Pdocker
48 changes: 46 additions & 2 deletions bobs-books/roberts-books/roberts-coherence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>
<version.lib.coherence>12.2.1-4-0</version.lib.coherence>
<version.lib.coherence>20.12</version.lib.coherence>
<version.lib.netty>4.1.43.Final</version.lib.netty>
<version.lib.httpclient>4.5.10</version.lib.httpclient>
</properties>
Expand Down Expand Up @@ -103,7 +103,7 @@

<dependencies>
<dependency>
<groupId>com.oracle.coherence</groupId>
<groupId>com.oracle.coherence.ce</groupId>
<artifactId>coherence</artifactId>
<version>${version.lib.coherence}</version>
</dependency>
Expand All @@ -113,4 +113,48 @@
<version>${version.lib.httpclient}</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>docker</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.7.1</version>
<configuration>
<from>
<image>
gcr.io/distroless/java:11
</image>
</from>
<to>
<image>ghcr.io/verrazzano/example-${project.artifactId}</image>
<tags>
<tag>${project.version}</tag>
</tags>
</to>
<container>
<mainClass>com.tangosol.net.DefaultCacheServer</mainClass>
<ports>
<port>9000</port>
</ports>
</container>
<containerizingMode>packaged</containerizingMode>
</configuration>
<executions>
<execution>
<goals>
<goal>dockerBuild</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
34 changes: 34 additions & 0 deletions bobs-books/roberts-books/roberts-coherence/src/main/k8s/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Copyright (c) 2021 Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
apiVersion: coherence.oracle.com/v1
kind: Coherence
metadata:
name: roberts-coherence
namespace: bobs-books
spec:
replicas: 3
image: ghcr.io/verrazzano/example-roberts-coherence:latest
imagePullPolicy: Always
env:
- name: BACKEND_PORT
value: "8001"
- name: BACKEND_HOSTNAME
value: bobs-bookstore-cluster-cluster-1.bobs-books.svc.cluster.local
- name: TRACING_HOST
value: "jaeger-collector"
- name: JAEGER_SAMPLER_TYPE
value: "const"
- name: JAEGER_SAMPLER_PARAM
value: "1"
jvm:
memory:
heapSize: 1g
ports:
- name: extend
port: 9000
service:
name: roberts-coherence-extend

0 comments on commit 2e787d8

Please sign in to comment.