-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7685 from planetf1/issue7684
- Loading branch information
Showing
2 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
113 changes: 113 additions & 0 deletions
113
open-metadata-resources/open-metadata-deployment/docker/egeria/Dockerfile.selfbuild
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,113 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright Contributors to the Egeria project. | ||
|
||
# Usage: docker run -d -p 9443:9443 odpi/egeria | ||
# | ||
# All dynamic data is stored under /deployments/data, so map a volume or k8s pvc to this | ||
# to persist egeria configuration, local graph repo etc ie | ||
# docker run -v source=egeria-data,target=/deployments/data odpi/egeria:latest | ||
# | ||
# See readme in source tree or on docker hub for more info | ||
|
||
# This is a self-build variation of the standard egeria Dockerfile - it will | ||
# build egeria within the container, and then configure it for subsequent execution | ||
|
||
# Based on RedHat UBI image. | ||
# https://catalog.redhat.com/software/containers/ubi9/openjdk-17-runtime/61ee7d45384a3eb331996bee | ||
|
||
|
||
# NOTE: Build args differ from the standard Dockerfile, as we need to get the right code to build from github | ||
|
||
ARG buildimg=registry.access.redhat.com/ubi9/openjdk-17 | ||
ARG runimg=registry.access.redhat.com/ubi9/openjdk-17 | ||
|
||
|
||
|
||
FROM $buildimg as build | ||
|
||
# Defaults to 'main' but could be 'egeria-release-4.0' or a commit id like '969fde1042fc4fda70961f979c4634159466e081' | ||
ARG srcref=main | ||
# Defaults to egeria repo - but could be a different fork if needed | ||
ARG srcurl=https://github.com/odpi/egeria | ||
# this should not be needed, and must match the source, but we'll use for now | ||
ARG version=4.1-SNAPSHOT | ||
# Replace build parms if needed | ||
ARG buildparms="build -x test -x javadoc --no-build-cache" | ||
# Can optionally specify build time so that we tag the image appropriately | ||
ARG now="<undefined>" | ||
|
||
ENV version ${version} | ||
ENV srcurl ${srcurl} | ||
ENV srcref ${srcref} | ||
ENV now ${now} | ||
|
||
# We need to install git -- and will continue the build as root - since this isn't runtime | ||
|
||
USER root | ||
RUN microdnf install -y git | ||
|
||
# Building egeria is simple - clone & run the gradle wrapper. Then we can copy the files over | ||
|
||
RUN cd /root && git clone $srcurl egeria -b $srcref && cd egeria && ./gradlew $buildparms | ||
|
||
# This can be switched to the runtime image for a smaller footprint image | ||
# However the JDK debugging tools will be lost, which are helpful in monitoring & undersanding performance/resource issues | ||
#FROM registry.access.redhat.com/ubi9/openjdk-17-runtime | ||
|
||
FROM $runimg | ||
|
||
# Defaults to 'main' but could be 'egeria-release-4.0' or a commit id like '969fde1042fc4fda70961f979c4634159466e081' | ||
ARG srcref=main | ||
# Defaults to egeria repo - but could be a different fork if needed | ||
ARG srcurl=https://github.com/odpi/egeria | ||
# this should not be needed, and must match the source, but we'll use for now | ||
ARG version=4.1-SNAPSHOT | ||
# Replace build parms if needed | ||
ARG buildparms="build -x test -x javadoc" | ||
# Can optionally specify build time so that we tag the image appropriately | ||
ARG now="<undefined>" | ||
|
||
ENV version ${version} | ||
ENV srcurl ${srcurl} | ||
ENV srcref ${srcref} | ||
ENV now ${now} | ||
|
||
# Labels from https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys (with additions prefixed ext) | ||
# Dates & commit refs are incomplete and only approximate if set/in terms of tags | ||
LABEL org.opencontainers.image.vendor = "LF AI&Data" \ | ||
org.opencontainers.image.title = "Egeria" \ | ||
org.opencontainers.image.description = "Common image for core ODPi Egeria runtime. Based on RedHat UBI 8 openjdk-17 image" \ | ||
org.opencontainers.image.url = "https://egeria-project/org/" \ | ||
org.opencontainers.image.source = "$srcurl" \ | ||
org.opencontainers.image.authors = "Egeria" \ | ||
org.opencontainers.image.revision = "$srcref" \ | ||
org.opencontainers.image.licenses = "Apache-2.0" \ | ||
org.opencontainers.image.created = "$now" \ | ||
org.opencontainers.image.version = "$srcref" \ | ||
org.opencontainers.image.documentation = "https://egeria-project.org" \ | ||
org.opencontainers.image.ext.docker.cmd = "docker run -d -p 9443:9443 odpi/egeria" \ | ||
org.opencontainers.image.ext.docker.cmd.devel = "docker run -d -p 9443:9443 -p 5005:5005 -e JAVA_DEBUG=true odpi/egeria" \ | ||
org.opencontainers.image.ext.docker.debug = "docker exec -it $CONTAINER /bin/sh" \ | ||
org.opencontainers.image.ext.docker.params = "JAVA_DEBUG=set to true to enable JVM debugging" | ||
|
||
# Copy egeria distribution | ||
COPY --from=build /root/egeria/open-metadata-distribution/open-metadata-assemblies/build/unpacked/egeria-$version-distribution.tar.gz /deployments | ||
|
||
# Expose port 8080 (default) for client access, and allow for 5005 being used for remote java debug | ||
EXPOSE 9443 5005 | ||
|
||
# By default, we run the server chassis | ||
ENV JAVA_APP_JAR=server/server-chassis-spring-${version}.jar | ||
|
||
# This is used with regular class loader, ie any client code etc | ||
# ENV JAVA_LIBDIR=/deployments/lib | ||
|
||
# This is used when running a spring app such as the server chassis (default) | ||
# Extend this accordingly via the environment, or within a new Dockerfile as needed | ||
ENV LOADER_PATH=/deployments/server/lib | ||
|
||
# Joloka will be removed shortly. For now disable to avoid errors | ||
ENV AB_JOLOKIA_OFF=true | ||
|
||
# See issue 3740 - we leave the metaspace size as unlimited - jvm default | ||
ENV JAVA_OPTS_APPEND="-XX:MaxMetaspaceSize=1g" |
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