From c865bc8b248c3a53640ba34c795c0a9570e84b72 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 7 May 2021 19:30:43 +0100 Subject: [PATCH] Base the docker image on alpine directly From the OpenJDK team: > The OpenJDK port for Alpine is not in a supported release by OpenJDK, since it is not in the mainline code base. It is only available as early access builds of OpenJDK Project Portola. See also [this comment](https://github.com/docker-library/openjdk/pull/235#issuecomment-424599754). So this image follows what is available from the OpenJDK project's maintainers. > > What this means is that Alpine based images are only released for early access release versions of OpenJDK. Once a particular release becomes a "General-Availability" release, the Alpine version is dropped from the "Supported Tags"; they are still available to pull, but will no longer be updated. --- Dockerfile | 17 +++++++++++++---- README.md | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index af1e536a..7c5aecde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,17 @@ -FROM openjdk:8-jdk-alpine +FROM alpine:3.13 -ENV JAVA_OPTS="" +LABEL maintainer="VLINGO XOOM Team " + +ENV JAVA_HOME=/usr/lib/jvm/default-jvm/ +ENV PATH=${JAVA_HOME}/bin:$PATH ENV XOOM_ENV="env" -ADD ./target/xoom-schemata-*-jar-with-dependencies.jar /app.jar +ADD ./target/xoom-schemata-*-jar-with-dependencies.jar /schemata/xoom-schemata.jar + +RUN addgroup -S xoom && adduser -S -D -s /sbin/nologin -h /schemata -G xoom xoom \ + && apk add --no-cache bash openjdk8 \ + && chown -R xoom:xoom /schemata -ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar $XOOM_ENV +WORKDIR /schemata +CMD java -jar /schemata/xoom-schemata.jar $XOOM_ENV +USER xoom diff --git a/README.md b/README.md index e1a7af08..e23e38dd 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,17 @@ The VLINGO XOOM Schema Registry. ## Quick Start +### Docker + +The quickest way to run XOOM Schemata is to use the [docker image](https://hub.docker.com/r/vlingo/xoom-schemata) +published by the VLINGO XOOM Team: + +```bash +docker run -it --rm -eXOOM_ENV=dev -p '9019:9019' vlingo/xoom-schemata +``` + +### Maven + :warning: Make sure you are using a Java 8 JDK. Build
& "{yourInstallPath}\xoom-schemata\mvnw.cmd" clean package -Pfrontend -f "{yourInstallPath}\xoom-schemata\pom.xml"
@@ -40,9 +51,9 @@ The maven build takes care of the following: * Run the UI build (`npm run export` in `src/main/frontend`) [Maven Profile 'frontend'] * Package the backend, frontend and dependencies within a fat jar -#### Docker Build: -After building, you can optionally build the docker container with `docker build . -t vlingo/xoom-schemata`. +#### Docker Build +After building, you can optionally build the docker container with `docker build . -t vlingo/xoom-schemata`. ### Run