Django Dockerfile: разница между зависимостями Linux Run/Build
Я пишу многоступенчатый / многопрофильный Dockerfile для приложения Wagtail (Django). В качестве отправной точки я взял этот пример . Также есть два похожих примера: Bakery Demo App / AccordBox article.
[01] RUN set -ex \
[02] && RUN_DEPS=" libexpat1 libjpeg62-turbo libpcre3 libpq5 \
[03] mime-support postgresql-client procps zlib1g \
[04] " \
[05] && seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} \
[06] && apt-get update && apt-get install -y --no-install-recommends $RUN_DEPS \
[07] && rm -rf /var/lib/apt/lists/*
[08]
[09] ADD requirements/ /requirements/
[10]
[11] RUN set -ex \
[12] && BUILD_DEPS=" build-essential git \
[13] libexpat1-dev libjpeg62-turbo-dev \
[14] libpcre3-dev libpq-dev zlib1g-dev \
[15] " \
[16] && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
[17] && python3.9 -m venv /venv \
[18] && /venv/bin/pip install -U pip \
[19] && /venv/bin/pip install --no-cache-dir -r /requirements/production.txt \
[20] && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
[21] && rm -rf /var/lib/apt/lists/*
- What's the essential difference between
RUN_DEPSandBUILD_DEPS? - Why
libjpeg62-turbo-devis inside theBUILD_DEPSandlibjpeg62-turbois insideRUN_DEPSlist and not vice versa. - How do I know what is the comprehensive list of all required
RUN_DEPS/BUILD_DEPSfor Wagtail / Django. As you can see in all those implementations mentioned above deps list varies. - Should lines [01-21] be treated as a whole in each build profile (dev, prod) except for
requirements.txtdifferences?