-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ct): add first draft of application container image #8934
- Loading branch information
1 parent
f817732
commit 19eedc4
Showing
4 changed files
with
185 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Dataverse Application Image | ||
=========================== | ||
|
||
Within the main repository, you may find the application image's files at ``<git root>/src/main/docker``. | ||
This Maven module, which also build the Dataverse WAR, uses the `Maven Docker Plugin <https://dmp.fabric8.io>`_ | ||
to build and ship the image within a special Maven profile. | ||
|
||
Contents | ||
++++++++ | ||
|
||
The application image builds by convention upon the :doc:`base image <base-image>` and provides: | ||
|
||
- Dataverse class files | ||
- Resource files | ||
- Scripts and associated data necessary for bootstrapping the application | ||
|
||
The image is provided as a multi-arch image to support the most common architectures Dataverse usually runs on: | ||
AMD64 (Windows/Linux/...) and ARM64 (Apple M1/M2). (Easy to extend.) | ||
|
||
Build Instructions | ||
++++++++++++++++++ | ||
|
||
Tunables | ||
++++++++ | ||
|
||
|
||
|
||
Hints | ||
+++++ | ||
|
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,48 @@ | ||
# Copyright 2022 Forschungszentrum Jülich GmbH | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
################################################################################################################ | ||
# | ||
# THIS FILE IS TO BE USED WITH MAVEN DOCKER BUILD: | ||
# mvn -Pct clean package docker:build | ||
# | ||
################################################################################################################ | ||
# | ||
# Some commands used are inspired by https://github.com/payara/Payara/tree/master/appserver/extras/docker-images. | ||
# Most parts origin from older versions of https://github.com/gdcc/dataverse-kubernetes. | ||
# | ||
# We are not using upstream Payara images because: | ||
# - Using same base image as Solr (https://hub.docker.com/_/solr) is reducing pulls | ||
# - Their image is less optimised for production usage and Dataverse by design choices | ||
# - We provide multi-arch images | ||
# - We provide some tweaks for development and monitoring | ||
# | ||
|
||
# Make the Java base image and version configurable (useful for trying newer Java versions and flavors) | ||
ARG BASE_IMAGE="gdcc/base:unstable" | ||
FROM $BASE_IMAGE | ||
|
||
# Copy app and deps from assembly in proper layers | ||
COPY --chown=payara:payara maven/deps ${DEPLOY_DIR}/dataverse/WEB-INF/lib/ | ||
COPY --chown=payara:payara maven/app ${DEPLOY_DIR}/dataverse/ | ||
COPY --chown=payara:payara maven/supplements ${DEPLOY_DIR}/dataverse/supplements/ | ||
|
||
# Create symlinks for jHove | ||
RUN ln -s "${DEPLOY_DIR}/dataverse/supplements/jhove.conf" "${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf" && \ | ||
ln -s "${DEPLOY_DIR}/dataverse/supplements/jhoveConfig.xsd" "${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhoveConfig.xsd" && \ | ||
sed -i "${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf" -e "s:/usr/local/payara./glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" | ||
|
||
LABEL org.opencontainers.image.created="@git.build.time@" \ | ||
org.opencontainers.image.authors="Research Data Management at FZJ <forschungsdaten@fz-juelich.de>" \ | ||
org.opencontainers.image.url="https://guides.dataverse.org/en/latest/container/" \ | ||
org.opencontainers.image.documentation="https://guides.dataverse.org/en/latest/container/" \ | ||
org.opencontainers.image.source="https://github.com/IQSS/dataverse" \ | ||
org.opencontainers.image.version="@project.version@" \ | ||
org.opencontainers.image.revision="@git.commit.id.abbrev@" \ | ||
org.opencontainers.image.vendor="Global Dataverse Community Consortium" \ | ||
org.opencontainers.image.licenses="Apache-2.0" \ | ||
org.opencontainers.image.title="Dataverse Application Image" \ | ||
org.opencontainers.image.description="This container image provides the research data repository software Dataverse in a box." |
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 @@ | ||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> | ||
<fileSets> | ||
<!-- Get our app, but exclude deps --> | ||
<fileSet> | ||
<directory>target/${project.artifactId}-${project.version}</directory> | ||
<outputDirectory>app</outputDirectory> | ||
<excludes> | ||
<exclude>WEB-INF/lib/**/*</exclude> | ||
</excludes> | ||
</fileSet> | ||
<!-- Get our dependencies in a seperate folder (image layer cache!) --> | ||
<fileSet> | ||
<directory>target/${project.artifactId}-${project.version}/WEB-INF/lib</directory> | ||
<outputDirectory>deps</outputDirectory> | ||
</fileSet> | ||
<!-- | ||
Supplemental data (configs, metadata, ...) | ||
TODO: Commented out TSVs and bootstrap scripts for now until we decide *where* the bootstrapping etc will happen. | ||
--> | ||
<!-- | ||
<fileSet> | ||
<directory>scripts/api</directory> | ||
<outputDirectory>supplements</outputDirectory> | ||
<includes> | ||
<include>data/**/*</include> | ||
<include>*.sh</include> | ||
</includes> | ||
<excludes> | ||
<exclude>data/metadatablocks/custom*.tsv</exclude> | ||
</excludes> | ||
</fileSet> | ||
--> | ||
<fileSet> | ||
<directory>conf/jhove</directory> | ||
<outputDirectory>supplements</outputDirectory> | ||
</fileSet> | ||
<!-- Init scripts and usage scripts (bootstrapping, configuration, ...) --> | ||
<fileSet> | ||
<directory>conf/container/scripts</directory> | ||
<outputDirectory>scripts</outputDirectory> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |