Skip to content

Commit 0a89f60

Browse files
committed
tweaks for permissions
1 parent fbdc933 commit 0a89f60

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

docker/datahub-ingestion-base/Dockerfile

+9-4
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,25 @@ RUN apt-get update && apt-get install -y -qq \
5656
# compiled against newer golang for security fixes
5757
COPY --from=dockerize-binary /go/bin/dockerize /usr/local/bin
5858

59+
RUN addgroup --gid 1000 datahub && \
60+
adduser --disabled-password --uid 1000 --gid 1000 --home /datahub-ingestion datahub
61+
5962
COPY ./docker/datahub-ingestion-base/base-requirements.txt requirements.txt
6063
COPY ./docker/datahub-ingestion-base/entrypoint.sh /entrypoint.sh
6164

65+
USER datahub
6266
ENV VIRTUAL_ENV=/.venv
67+
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
6368
RUN python3 -m venv $VIRTUAL_ENV && \
6469
uv pip install --no-cache -r requirements.txt && \
6570
pip uninstall -y acryl-datahub && \
66-
chmod +x /entrypoint.sh && \
67-
addgroup --gid 1000 datahub && \
68-
adduser --disabled-password --uid 1000 --gid 1000 --home /datahub-ingestion datahub
71+
chmod +x /entrypoint.sh
6972

7073
ENTRYPOINT [ "/entrypoint.sh" ]
7174

7275
FROM ${BASE_IMAGE} as full-install
7376

77+
USER 0
7478
RUN apt-get update && apt-get install -y -qq \
7579
default-jre-headless \
7680
&& rm -rf /var/lib/apt/lists/* /var/cache/apk/*
@@ -93,10 +97,11 @@ RUN if [ $(arch) = "x86_64" ]; then \
9397
ldconfig; \
9498
fi;
9599

100+
USER datahub
101+
96102
FROM ${BASE_IMAGE} as slim-install
97103
# Do nothing else on top of base
98104

99105
FROM ${APP_ENV}-install
100106

101-
USER datahub
102107
ENV PATH="/datahub-ingestion/.local/bin:$PATH"

docker/datahub-ingestion/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ USER datahub
3939
COPY ./docker/datahub-ingestion/pyspark_jars.sh .
4040

4141
RUN if [ "${PIP_MIRROR_URL}" != "null" ] ; then pip config set global.index-url ${PIP_MIRROR_URL} ; fi
42-
RUN uv pip install --no-cache "acryl-datahub[base,all] @ ." "acryl-datahub-airflow-plugin[plugin-v2] @ ./airflow-plugin"
42+
RUN uv pip install --no-cache "acryl-datahub[base,all] @ ." "acryl-datahub-airflow-plugin[plugin-v2] @ ./airflow-plugin" && \
43+
datahub --version
4344
RUN ./pyspark_jars.sh
4445

4546
FROM base as full-install
@@ -54,4 +55,4 @@ FROM base as dev-install
5455
FROM ${APP_ENV}-install as final
5556

5657
USER datahub
57-
ENV PATH="/datahub-ingestion/.local/bin:$VIRTUAL_ENV/bin:$PATH"
58+
ENV PATH="/datahub-ingestion/.local/bin:$PATH"

docker/datahub-ingestion/Dockerfile-slim-only

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ FROM base as slim-install
2222
ARG PIP_MIRROR_URL
2323

2424
RUN if [ "${PIP_MIRROR_URL}" != "null" ] ; then pip config set global.index-url ${PIP_MIRROR_URL} ; fi
25-
RUN uv pip install --no-cache "acryl-datahub[base,datahub-rest,datahub-kafka,snowflake,bigquery,redshift,mysql,postgres,hive,clickhouse,glue,dbt,looker,lookml,tableau,powerbi,superset,datahub-business-glossary] @ ."
25+
RUN uv pip install --no-cache "acryl-datahub[base,datahub-rest,datahub-kafka,snowflake,bigquery,redshift,mysql,postgres,hive,clickhouse,glue,dbt,looker,lookml,tableau,powerbi,superset,datahub-business-glossary] @ ." && \
26+
datahub --version
2627

2728
FROM slim-install as final
2829

2930
USER datahub
30-
ENV PATH="/datahub-ingestion/.local/bin:$VIRTUAL_ENV/bin:$PATH"
31+
ENV PATH="/datahub-ingestion/.local/bin:$PATH"

0 commit comments

Comments
 (0)