forked from acryldata/datahub-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (42 loc) · 2.12 KB
/
Dockerfile
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
# Copyright 2021 Acryl Data, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Defining environment
ARG APP_ENV=prod
FROM acryldata/datahub-ingestion-base:latest as prod-install
COPY datahub-actions /actions-src
RUN mkdir -p /etc/datahub/actions && mkdir -p /tmp/datahub/logs/actions/system
RUN cd /actions-src && \
pip install "." && \
pip install '.[all]' && \
# This is required to fix security vulnerability in htrace-core4
rm -f /usr/local/lib/python3.10/site-packages/pyspark/jars/htrace-core4-4.1.0-incubating.jar
COPY ./docker/datahub-actions/start.sh /start_datahub_actions.sh
COPY ./docker/datahub-actions/readiness-check.sh /readiness-check.sh
RUN chmod a+x /start_datahub_actions.sh
# Add other default configurations into this!
RUN mkdir -p /etc/datahub/actions/conf && mkdir -p /etc/datahub/actions/system/conf
COPY ./docker/config/*.yaml /etc/datahub/actions/system/conf
RUN addgroup --system datahub && adduser --system datahub --ingroup datahub \
&& chown datahub /etc/datahub \
&& chown -R datahub /tmp/datahub
# By transferring the root user's pip cache directory to the datahub
# user, we can avoid the need for some redundant dependency downloads.
RUN mkdir -p /home/datahub/.cache \
&& mv /root/.cache/pip /home/datahub/.cache/pip \
&& chown -R datahub /home/datahub/.cache/pip
FROM ${APP_ENV}-install as final
USER datahub
RUN curl -s "https://get.sdkman.io" | bash
RUN /bin/bash -c "source /$HOME/.sdkman/bin/sdkman-init.sh; sdk version; sdk install java 8.0.332-zulu"
CMD dockerize -wait ${DATAHUB_GMS_PROTOCOL:-http}://$DATAHUB_GMS_HOST:$DATAHUB_GMS_PORT/health -timeout 240s /start_datahub_actions.sh