2020-08-06 16:38:53 -07:00
|
|
|
# Defining environment
|
|
|
|
ARG APP_ENV=prod
|
|
|
|
|
2021-06-23 13:55:14 -07:00
|
|
|
FROM adoptopenjdk/openjdk8:alpine-jre as base
|
2020-08-06 16:38:53 -07:00
|
|
|
ENV DOCKERIZE_VERSION v0.6.1
|
2021-12-14 02:39:48 +09:00
|
|
|
RUN apk --no-cache add curl tar wget bash coreutils \
|
2021-09-07 23:06:15 -07:00
|
|
|
&& wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.4.1/opentelemetry-javaagent-all.jar \
|
|
|
|
&& wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar -O jmx_prometheus_javaagent.jar \
|
2020-08-06 16:38:53 -07:00
|
|
|
&& curl -L https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar -C /usr/local/bin -xzv
|
|
|
|
|
2021-06-23 13:55:14 -07:00
|
|
|
FROM adoptopenjdk/openjdk8:alpine-slim as prod-build
|
2022-01-21 09:57:54 -06:00
|
|
|
RUN apk --no-cache add openjdk8-jre perl
|
2020-08-06 16:38:53 -07:00
|
|
|
COPY . datahub-src
|
2021-06-23 13:55:14 -07:00
|
|
|
RUN cd datahub-src && ./gradlew :metadata-jobs:mae-consumer-job:build -x test
|
2020-08-06 16:38:53 -07:00
|
|
|
RUN cd datahub-src && cp metadata-jobs/mae-consumer-job/build/libs/mae-consumer-job.jar ../mae-consumer-job.jar
|
|
|
|
|
|
|
|
FROM base as prod-install
|
|
|
|
COPY --from=prod-build /mae-consumer-job.jar /datahub/datahub-mae-consumer/bin/
|
2021-07-30 17:41:03 -07:00
|
|
|
COPY --from=prod-build /datahub-src/metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-mae-consumer/resources/entity-registry.yml
|
2020-08-06 16:38:53 -07:00
|
|
|
COPY --from=prod-build /datahub-src/docker/datahub-mae-consumer/start.sh /datahub/datahub-mae-consumer/scripts/
|
2021-09-07 23:06:15 -07:00
|
|
|
COPY --from=prod-build /datahub-src/docker/monitoring/client-prometheus-config.yaml /datahub/datahub-mae-consumer/scripts/prometheus-config.yaml
|
2020-08-06 16:38:53 -07:00
|
|
|
RUN chmod +x /datahub/datahub-mae-consumer/scripts/start.sh
|
|
|
|
|
2022-01-21 09:57:54 -06:00
|
|
|
# Setup TLS JKS
|
|
|
|
COPY --from=prod-build /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/cacerts /tmp/kafka.client.truststore.jks
|
|
|
|
|
2020-08-06 16:38:53 -07:00
|
|
|
FROM base as dev-install
|
|
|
|
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
|
|
|
|
# See this excellent thread https://github.com/docker/cli/issues/1134
|
|
|
|
|
|
|
|
FROM ${APP_ENV}-install as final
|
|
|
|
|
2020-10-06 14:35:38 +03:00
|
|
|
RUN addgroup -S datahub && adduser -S datahub -G datahub
|
|
|
|
USER datahub
|
|
|
|
|
2021-03-31 06:03:27 +01:00
|
|
|
ENV JMX_OPTS=""
|
|
|
|
ENV JAVA_OPTS=""
|
|
|
|
|
2020-08-06 16:38:53 -07:00
|
|
|
EXPOSE 9090
|
|
|
|
|
2021-03-23 15:15:16 -07:00
|
|
|
HEALTHCHECK --start-period=2m --retries=4 CMD curl --fail http://localhost:9091/actuator/health || exit 1
|
|
|
|
|
2020-08-06 16:38:53 -07:00
|
|
|
CMD /datahub/datahub-mae-consumer/scripts/start.sh
|