# Defining environment ARG APP_ENV=prod FROM python:3.8 as base # ENV DOCKERIZE_VERSION v0.6.1 # RUN apk --no-cache add curl tar \ # && curl https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-runner/9.4.20.v20190813/jetty-runner-9.4.20.v20190813.jar --output jetty-runner.jar \ # && curl -L https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar -C /usr/local/bin -xzv RUN apt-get update && apt-get install -y \ jq \ librdkafka-dev \ python3-ldap \ libldap2-dev \ libsasl2-dev \ libsasl2-modules \ ldap-utils \ && python -m pip install --upgrade pip wheel setuptools==57.5.0 FROM openjdk:8 as prod-build COPY . /datahub-src RUN cd /datahub-src && ./gradlew :metadata-events:mxe-schemas:build FROM base as prod-codegen COPY --from=prod-build /datahub-src /datahub-src RUN cd /datahub-src/metadata-ingestion && \ pip install -e ".[base]" && \ ./scripts/codegen.sh FROM base as prod-install COPY --from=prod-codegen /datahub-src/metadata-ingestion /datahub-ingestion ARG RELEASE_VERSION RUN cd /datahub-ingestion && \ sed -i.bak "s/__version__ = \"0.0.0.dev0\"/__version__ = \"$RELEASE_VERSION\"/" src/datahub/__init__.py && \ cat src/datahub/__init__.py && \ pip install ".[all]" 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 RUN addgroup --system datahub && adduser --system datahub --ingroup datahub USER datahub ENTRYPOINT [ "datahub" ]