2023-08-17 00:10:17 -05:00
|
|
|
ARG APP_ENV=full
|
|
|
|
ARG BASE_IMAGE=base
|
|
|
|
|
2023-11-28 21:52:11 +01:00
|
|
|
# Defining custom repo urls for use in enterprise environments. Re-used between stages below.
|
|
|
|
ARG ALPINE_REPO_URL=http://dl-cdn.alpinelinux.org/alpine
|
|
|
|
ARG GITHUB_REPO_URL=https://github.com
|
2023-12-18 14:06:17 -08:00
|
|
|
ARG DEBIAN_REPO_URL=https://deb.debian.org/debian
|
2023-11-28 21:52:11 +01:00
|
|
|
ARG PIP_MIRROR_URL=null
|
|
|
|
|
2023-10-17 15:40:38 -05:00
|
|
|
FROM golang:1-alpine3.18 AS dockerize-binary
|
2022-06-27 14:08:16 +05:30
|
|
|
|
2023-11-28 21:52:11 +01:00
|
|
|
# Re-declaring arg from above to make it available in this stage (will inherit default value)
|
|
|
|
ARG ALPINE_REPO_URL
|
|
|
|
|
2022-09-07 17:51:06 +01:00
|
|
|
ENV DOCKERIZE_VERSION v0.6.1
|
2023-03-20 18:06:35 -05:00
|
|
|
WORKDIR /go/src/github.com/jwilder
|
|
|
|
|
2023-11-28 21:52:11 +01:00
|
|
|
# Optionally set corporate mirror for apk
|
|
|
|
RUN if [ "${ALPINE_REPO_URL}" != "http://dl-cdn.alpinelinux.org/alpine" ] ; then sed -i "s#http.*://dl-cdn.alpinelinux.org/alpine#${ALPINE_REPO_URL}#g" /etc/apk/repositories ; fi
|
|
|
|
|
2023-03-20 18:06:35 -05:00
|
|
|
RUN apk --no-cache --update add openssl git tar curl
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/jwilder/dockerize
|
|
|
|
|
|
|
|
RUN go install github.com/jwilder/dockerize@$DOCKERIZE_VERSION
|
|
|
|
|
|
|
|
FROM python:3.10 as base
|
|
|
|
|
2023-11-28 21:52:11 +01:00
|
|
|
ARG DEBIAN_REPO_URL
|
|
|
|
ARG PIP_MIRROR_URL
|
|
|
|
ARG GITHUB_REPO_URL
|
|
|
|
|
2022-09-07 17:51:06 +01:00
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2023-11-28 21:52:11 +01:00
|
|
|
# Optionally set corporate mirror for apk and pip
|
|
|
|
RUN if [ "${DEBIAN_REPO_URL}" != "http://deb.debian.org/debian" ] ; then sed -i "s#http.*://deb.debian.org/debian#${DEBIAN_REPO_URL}#g" /etc/apt/sources.list.d/debian.sources ; fi
|
|
|
|
RUN if [ "${PIP_MIRROR_URL}" != "null" ] ; then pip config set global.index-url ${PIP_MIRROR_URL} ; fi
|
|
|
|
|
2023-08-17 00:10:17 -05:00
|
|
|
RUN apt-get update && apt-get install -y -qq \
|
2022-09-07 17:51:06 +01:00
|
|
|
python3-ldap \
|
|
|
|
libldap2-dev \
|
|
|
|
libsasl2-dev \
|
|
|
|
libsasl2-modules \
|
|
|
|
libaio1 \
|
|
|
|
libsasl2-modules-gssapi-mit \
|
|
|
|
krb5-user \
|
|
|
|
wget \
|
|
|
|
zip \
|
|
|
|
unzip \
|
|
|
|
ldap-utils \
|
2024-01-23 22:34:18 -08:00
|
|
|
unixodbc \
|
|
|
|
libodbc2 \
|
2024-02-26 15:02:47 -08:00
|
|
|
&& python -m pip install --no-cache --upgrade pip uv>=0.1.10 wheel setuptools \
|
2023-08-17 00:10:17 -05:00
|
|
|
&& rm -rf /var/lib/apt/lists/* /var/cache/apk/*
|
|
|
|
|
|
|
|
# compiled against newer golang for security fixes
|
2023-09-26 00:10:49 -04:00
|
|
|
COPY --from=dockerize-binary /go/bin/dockerize /usr/local/bin
|
2022-09-07 17:51:06 +01:00
|
|
|
|
2023-08-17 00:10:17 -05:00
|
|
|
COPY ./docker/datahub-ingestion-base/base-requirements.txt requirements.txt
|
|
|
|
COPY ./docker/datahub-ingestion-base/entrypoint.sh /entrypoint.sh
|
|
|
|
|
2024-02-26 15:02:47 -08:00
|
|
|
RUN addgroup --gid 1000 datahub && \
|
|
|
|
adduser --disabled-password --uid 1000 --gid 1000 --home /datahub-ingestion datahub && \
|
|
|
|
chmod +x /entrypoint.sh
|
|
|
|
|
|
|
|
USER datahub
|
|
|
|
ENV VIRTUAL_ENV=/datahub-ingestion/.venv
|
|
|
|
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
|
|
|
|
RUN python3 -m venv $VIRTUAL_ENV && \
|
|
|
|
uv pip install --no-cache -r requirements.txt && \
|
|
|
|
pip uninstall -y acryl-datahub
|
2023-08-17 00:10:17 -05:00
|
|
|
|
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
|
|
|
|
|
|
|
FROM ${BASE_IMAGE} as full-install
|
|
|
|
|
2024-02-26 15:02:47 -08:00
|
|
|
USER 0
|
2023-08-17 00:10:17 -05:00
|
|
|
RUN apt-get update && apt-get install -y -qq \
|
|
|
|
default-jre-headless \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /var/cache/apk/*
|
|
|
|
|
2022-09-07 17:51:06 +01:00
|
|
|
RUN if [ $(arch) = "x86_64" ]; then \
|
|
|
|
mkdir /opt/oracle && \
|
|
|
|
cd /opt/oracle && \
|
|
|
|
wget --no-verbose -c https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-basic-linux.x64-21.6.0.0.0dbru.zip && \
|
|
|
|
unzip instantclient-basic-linux.x64-21.6.0.0.0dbru.zip && \
|
|
|
|
rm instantclient-basic-linux.x64-21.6.0.0.0dbru.zip && \
|
|
|
|
sh -c "echo /opt/oracle/instantclient_21_6 > /etc/ld.so.conf.d/oracle-instantclient.conf" && \
|
|
|
|
ldconfig; \
|
|
|
|
else \
|
|
|
|
mkdir /opt/oracle && \
|
|
|
|
cd /opt/oracle && \
|
|
|
|
wget --no-verbose -c https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-basic-linux.arm64-19.10.0.0.0dbru.zip && \
|
|
|
|
unzip instantclient-basic-linux.arm64-19.10.0.0.0dbru.zip && \
|
|
|
|
rm instantclient-basic-linux.arm64-19.10.0.0.0dbru.zip && \
|
|
|
|
sh -c "echo /opt/oracle/instantclient_19_10 > /etc/ld.so.conf.d/oracle-instantclient.conf" && \
|
|
|
|
ldconfig; \
|
|
|
|
fi;
|
2022-06-27 17:28:12 +05:30
|
|
|
|
2024-02-26 15:02:47 -08:00
|
|
|
USER datahub
|
|
|
|
|
2023-08-17 00:10:17 -05:00
|
|
|
FROM ${BASE_IMAGE} as slim-install
|
|
|
|
# Do nothing else on top of base
|
|
|
|
|
|
|
|
FROM ${APP_ENV}-install
|
2022-06-27 14:08:16 +05:30
|
|
|
|
2023-11-28 21:52:11 +01:00
|
|
|
ENV PATH="/datahub-ingestion/.local/bin:$PATH"
|