-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use common base docker images to share layers across service images
- Loading branch information
Showing
35 changed files
with
501 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ARG TAG=latest | ||
FROM geoservercloud/gs-cloud-base-jre:$TAG as builder | ||
ARG JAR_FILE=target/gs-cloud-*-bin.jar | ||
|
||
COPY ${JAR_FILE} application.jar | ||
|
||
RUN java -Djarmode=layertools -jar application.jar extract | ||
|
||
########## | ||
FROM geoservercloud/gs-cloud-base-spring-boot:$TAG | ||
|
||
# init | ||
RUN apt update \ | ||
&& apt -y upgrade \ | ||
&& apt install -y --no-install-recommends \ | ||
fonts-deva \ | ||
fonts-font-awesome \ | ||
fonts-freefont-ttf \ | ||
fonts-material-design-icons-iconfont \ | ||
fonts-materialdesignicons-webfont \ | ||
fonts-roboto \ | ||
&& apt clean \ | ||
&& apt purge -y \ | ||
&& apt autoremove --purge -y \ | ||
&& rm -rf /var/cache/apt/* \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /opt/app/data_directory /data/geowebcache \ | ||
&& chmod 0777 /opt/app/data_directory /data/geowebcache | ||
|
||
VOLUME /opt/app/data_directory | ||
VOLUME /data/geowebcache | ||
|
||
WORKDIR /opt/app/bin | ||
|
||
COPY --from=builder dependencies/ ./ | ||
COPY --from=builder snapshot-dependencies/ ./ | ||
COPY --from=builder spring-boot-loader/ ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.geoserver.cloud.apps</groupId> | ||
<artifactId>gs-cloud-base-images</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>gs-cloud-base-geoserver-image</artifactId> | ||
<packaging>jar</packaging> | ||
<properties> | ||
<dockerfile.skip>false</dockerfile.skip> | ||
<docker.image.name>${project.artifactId}</docker.image.name> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-spring-factory</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starter-webmvc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starter-security</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starter-event-bus</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>spring-boot-simplejndi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starter-vector-formats</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starter-raster-formats</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-bootstrap</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.retry</groupId> | ||
<artifactId>spring-retry</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-aop</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geoserver.cloud.apps</groupId> | ||
<artifactId>gs-cloud-base-spring-boot</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
<profiles> | ||
<profile> | ||
<id>docker</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
<property> | ||
<name>docker</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.spotify</groupId> | ||
<artifactId>dockerfile-maven-plugin</artifactId> | ||
<configuration> | ||
<pullNewerImage>false</pullNewerImage> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>push</id> | ||
<configuration> | ||
<!-- always skip push --> | ||
<skip>true</skip> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
18 changes: 18 additions & 0 deletions
18
src/apps/base-images/geoserver/src/main/java/org/geoserver/cloud/app/dummy/DummyApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* (c) 2022 Open Source Geospatial Foundation - all rights reserved This code is licensed under the | ||
* GPL 2.0 license, available at the root application directory. | ||
*/ | ||
package org.geoserver.cloud.app.dummy; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** | ||
* @since 1.0 | ||
*/ | ||
@SpringBootApplication | ||
public class DummyApp { | ||
|
||
public static void main(String... args) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM eclipse-temurin:17-jre | ||
|
||
LABEL maintainer="GeoServer PSC <[email protected]>" | ||
|
||
ENV JAVA_TOOL_OPTS="\ | ||
--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED \ | ||
--add-opens=java.base/java.lang=ALL-UNNAMED \ | ||
--add-opens=java.base/java.util=ALL-UNNAMED \ | ||
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \ | ||
--add-opens=java.base/java.text=ALL-UNNAMED \ | ||
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED \ | ||
--add-opens=java.desktop/sun.awt.image=ALL-UNNAMED \ | ||
--add-opens=java.naming/com.sun.jndi.ldap=ALL-UNNAMED \ | ||
-Djava.awt.headless=true" | ||
|
||
ENV JAVA_OPTS= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.geoserver.cloud.apps</groupId> | ||
<artifactId>gs-cloud-base-images</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>gs-cloud-base-jre</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Base JRE image</name> | ||
<properties> | ||
<dockerfile.skip>false</dockerfile.skip> | ||
<docker.image.name>${project.artifactId}</docker.image.name> | ||
</properties> | ||
<dependencies></dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<version>${spring-boot.version}</version> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>docker</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
<property> | ||
<name>docker</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.spotify</groupId> | ||
<artifactId>dockerfile-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>push</id> | ||
<configuration> | ||
<!-- always skip push --> | ||
<skip>true</skip> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.geoserver.cloud.apps</groupId> | ||
<artifactId>gs-cloud-apps</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>gs-cloud-base-images</artifactId> | ||
<packaging>pom</packaging> | ||
<modules> | ||
<module>jre</module> | ||
<module>spring-boot</module> | ||
<module>geoserver</module> | ||
</modules> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ARG TAG=latest | ||
FROM geoservercloud/gs-cloud-base-jre:$TAG as builder | ||
ARG JAR_FILE=target/gs-cloud-*-bin.jar | ||
|
||
COPY ${JAR_FILE} application.jar | ||
|
||
RUN java -Djarmode=layertools -jar application.jar extract | ||
|
||
########## | ||
FROM geoservercloud/gs-cloud-base-jre:$TAG | ||
|
||
COPY target/config/ /etc/gscloud/ | ||
|
||
RUN mkdir -p /opt/app/bin | ||
|
||
WORKDIR /opt/app/bin | ||
|
||
ENV JAVA_TOOL_OPTS="\ | ||
--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED \ | ||
--add-opens=java.base/java.lang=ALL-UNNAMED \ | ||
--add-opens=java.base/java.util=ALL-UNNAMED \ | ||
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \ | ||
--add-opens=java.base/java.text=ALL-UNNAMED \ | ||
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED \ | ||
--add-opens=java.desktop/sun.awt.image=ALL-UNNAMED \ | ||
--add-opens=java.naming/com.sun.jndi.ldap=ALL-UNNAMED \ | ||
-Djava.awt.headless=true" | ||
|
||
ENV JAVA_OPTS= | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
|
||
COPY --from=builder dependencies/ ./ | ||
COPY --from=builder snapshot-dependencies/ ./ | ||
COPY --from=builder spring-boot-loader/ ./ | ||
|
||
HEALTHCHECK \ | ||
--interval=10s \ | ||
--timeout=5s \ | ||
--start-period=30s \ | ||
--retries=5 \ | ||
CMD curl -f -s -o /dev/null localhost:8081/actuator/health || exit 1 | ||
|
||
CMD exec env USER_ID="$(id -u)" USER_GID="$(id -g)" java $JAVA_OPTS $JAVA_TOOL_OPTS org.springframework.boot.loader.JarLauncher |
Oops, something went wrong.