chore(docker): move mysql os-level deps (GPL) to dev image only (#29771)

This commit is contained in:
Maxime Beauchemin 2024-09-15 09:24:14 -07:00 committed by GitHub
parent e9094659d3
commit bcbd679a75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 7 deletions

View File

@ -98,7 +98,6 @@ RUN mkdir -p ${PYTHONPATH} superset/static requirements superset-frontend apache
&& useradd --user-group -d ${SUPERSET_HOME} -m --no-log-init --shell /bin/bash superset \ && useradd --user-group -d ${SUPERSET_HOME} -m --no-log-init --shell /bin/bash superset \
&& apt-get update -qq && apt-get install -yqq --no-install-recommends \ && apt-get update -qq && apt-get install -yqq --no-install-recommends \
curl \ curl \
default-libmysqlclient-dev \
libsasl2-dev \ libsasl2-dev \
libsasl2-modules-gssapi-mit \ libsasl2-modules-gssapi-mit \
libpq-dev \ libpq-dev \
@ -115,8 +114,8 @@ COPY --chown=superset:superset requirements/base.txt requirements/
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
apt-get update -qq && apt-get install -yqq --no-install-recommends \ apt-get update -qq && apt-get install -yqq --no-install-recommends \
build-essential \ build-essential \
&& pip install --upgrade setuptools pip \ && pip install --no-cache-dir --upgrade setuptools pip \
&& pip install -r requirements/base.txt \ && pip install --no-cache-dir -r requirements/base.txt \
&& apt-get autoremove -yqq --purge build-essential \ && apt-get autoremove -yqq --purge build-essential \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -126,7 +125,7 @@ COPY --chown=superset:superset --from=superset-node /app/superset/static/assets
## Lastly, let's install superset itself ## Lastly, let's install superset itself
COPY --chown=superset:superset superset superset COPY --chown=superset:superset superset superset
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
pip install -e . pip install --no-cache-dir -e .
# Copy the .json translations from the frontend layer # Copy the .json translations from the frontend layer
COPY --chown=superset:superset --from=superset-node /app/superset/translations superset/translations COPY --chown=superset:superset --from=superset-node /app/superset/translations superset/translations
@ -166,7 +165,7 @@ RUN apt-get update -qq \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
pip install playwright pip install --no-cache-dir playwright
RUN playwright install-deps RUN playwright install-deps
RUN if [ "$INCLUDE_CHROMIUM" = "true" ]; then \ RUN if [ "$INCLUDE_CHROMIUM" = "true" ]; then \
@ -188,12 +187,16 @@ RUN if [ "$INCLUDE_FIREFOX" = "true" ]; then \
&& apt-get autoremove -yqq --purge wget bzip2 && rm -rf /var/[log,tmp]/* /tmp/* /var/lib/apt/lists/*; \ && apt-get autoremove -yqq --purge wget bzip2 && rm -rf /var/[log,tmp]/* /tmp/* /var/lib/apt/lists/*; \
fi fi
# Cache everything for dev purposes... # Installing mysql client os-level dependencies in dev image only because GPL
RUN apt-get install -yqq --no-install-recommends \
default-libmysqlclient-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --chown=superset:superset requirements/development.txt requirements/ COPY --chown=superset:superset requirements/development.txt requirements/
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
apt-get update -qq && apt-get install -yqq --no-install-recommends \ apt-get update -qq && apt-get install -yqq --no-install-recommends \
build-essential \ build-essential \
&& pip install -r requirements/development.txt \ && pip install --no-cache-dir -r requirements/development.txt \
&& apt-get autoremove -yqq --purge build-essential \ && apt-get autoremove -yqq --purge build-essential \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*