Skip to content

Commit bcbd679

Browse files
authored
chore(docker): move mysql os-level deps (GPL) to dev image only (#29771)
1 parent e909465 commit bcbd679

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ RUN mkdir -p ${PYTHONPATH} superset/static requirements superset-frontend apache
9898
&& useradd --user-group -d ${SUPERSET_HOME} -m --no-log-init --shell /bin/bash superset \
9999
&& apt-get update -qq && apt-get install -yqq --no-install-recommends \
100100
curl \
101-
default-libmysqlclient-dev \
102101
libsasl2-dev \
103102
libsasl2-modules-gssapi-mit \
104103
libpq-dev \
@@ -115,8 +114,8 @@ COPY --chown=superset:superset requirements/base.txt requirements/
115114
RUN --mount=type=cache,target=/root/.cache/pip \
116115
apt-get update -qq && apt-get install -yqq --no-install-recommends \
117116
build-essential \
118-
&& pip install --upgrade setuptools pip \
119-
&& pip install -r requirements/base.txt \
117+
&& pip install --no-cache-dir --upgrade setuptools pip \
118+
&& pip install --no-cache-dir -r requirements/base.txt \
120119
&& apt-get autoremove -yqq --purge build-essential \
121120
&& rm -rf /var/lib/apt/lists/*
122121

@@ -126,7 +125,7 @@ COPY --chown=superset:superset --from=superset-node /app/superset/static/assets
126125
## Lastly, let's install superset itself
127126
COPY --chown=superset:superset superset superset
128127
RUN --mount=type=cache,target=/root/.cache/pip \
129-
pip install -e .
128+
pip install --no-cache-dir -e .
130129

131130
# Copy the .json translations from the frontend layer
132131
COPY --chown=superset:superset --from=superset-node /app/superset/translations superset/translations
@@ -166,7 +165,7 @@ RUN apt-get update -qq \
166165
&& rm -rf /var/lib/apt/lists/*
167166

168167
RUN --mount=type=cache,target=/root/.cache/pip \
169-
pip install playwright
168+
pip install --no-cache-dir playwright
170169
RUN playwright install-deps
171170

172171
RUN if [ "$INCLUDE_CHROMIUM" = "true" ]; then \
@@ -188,12 +187,16 @@ RUN if [ "$INCLUDE_FIREFOX" = "true" ]; then \
188187
&& apt-get autoremove -yqq --purge wget bzip2 && rm -rf /var/[log,tmp]/* /tmp/* /var/lib/apt/lists/*; \
189188
fi
190189

191-
# Cache everything for dev purposes...
190+
# Installing mysql client os-level dependencies in dev image only because GPL
191+
RUN apt-get install -yqq --no-install-recommends \
192+
default-libmysqlclient-dev \
193+
&& rm -rf /var/lib/apt/lists/*
194+
192195
COPY --chown=superset:superset requirements/development.txt requirements/
193196
RUN --mount=type=cache,target=/root/.cache/pip \
194197
apt-get update -qq && apt-get install -yqq --no-install-recommends \
195198
build-essential \
196-
&& pip install -r requirements/development.txt \
199+
&& pip install --no-cache-dir -r requirements/development.txt \
197200
&& apt-get autoremove -yqq --purge build-essential \
198201
&& rm -rf /var/lib/apt/lists/*
199202

0 commit comments

Comments
 (0)