-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile-fast
61 lines (50 loc) · 2.23 KB
/
Dockerfile-fast
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM openjdk:17-jdk-slim-buster AS dqo-libs
RUN apt-get update && apt-get install -y unzip
WORKDIR /workspace/app
COPY ./distribution/target/ /workspace/app/temp/
COPY VERSION /workspace/app/temp/
RUN unzip /workspace/app/temp/dqo-distribution-$(cat /workspace/app/temp/VERSION)-bin.zip -d /workspace/app/home
WORKDIR /workspace/app/home
RUN mkdir -p /workspace/app/home/expanded && (cd expanded; jar -xf ../jars/dqo-dqops-$(cat /workspace/app/temp/VERSION).jar) && rm /workspace/app/home/jars/dqo-dqops-$(cat /workspace/app/temp/VERSION).jar
FROM python:3.12.0-slim-bookworm AS dqo-home
WORKDIR /dqo
# copy dqo home
COPY home home
WORKDIR /dqo/home
RUN rm -rf venv/ && rm lib/requirements_dev.txt
# recreate venv
ENV VIRTUAL_ENV=/dqo/home/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY home/lib/requirements.txt /dqo/home/venv/home_requirements.txt
RUN python3 -m pip install setuptools && python3 -m pip install -r $VIRTUAL_ENV/home_requirements.txt
RUN python3 -m compileall ./
FROM python:3.12.0-slim-bookworm AS dqo-main
EXPOSE 8888
WORKDIR /dqo
# install java
RUN apt-get update && apt-get install -y openjdk-17-jre-headless && apt-get clean
ARG TARGETARCH=amd64
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-$TARGETARCH
ENV PATH=$JAVA_HOME/bin:$PATH
# dqo launch setup
ENV DQO_HOME=/dqo/home
ENV DQO_USER_HOME=/dqo/userhome
ENV DQO_USER_INITIALIZE_USER_HOME=true
ENV DQO_USER_INITIALIZE_DEFAULT_CLOUD_CREDENTIALS=true
ENV DQO_LOGGING_CONSOLE_IMMEDIATE_FLUSH=true
ENV AZURE_ENABLE_HTTP_CLIENT_SHARING=true
RUN mkdir $DQO_USER_HOME
RUN touch $DQO_USER_HOME/.DQO_USER_HOME_NOT_MOUNTED
COPY --from=dqo-home /dqo/home home
COPY distribution/dqo_docker_entrypoint.sh /dqo/home/bin/
RUN chmod +x /dqo/home/bin/dqo_docker_entrypoint.sh
RUN mkdir -p /etc/pki/tls/certs && ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
# copy spring dependencies
ARG DEPENDENCY=/workspace/app/home
COPY --from=dqo-libs ${DEPENDENCY}/jars /dqo/app/lib
COPY --from=dqo-libs ${DEPENDENCY}/expanded/BOOT-INF/lib /dqo/app/lib
COPY --from=dqo-libs ${DEPENDENCY}/expanded/META-INF /dqo/app/META-INF
COPY --from=dqo-libs ${DEPENDENCY}/expanded/BOOT-INF/classes /dqo/app
WORKDIR /dqo/userhome
ENTRYPOINT ["/dqo/home/bin/dqo_docker_entrypoint.sh"]