From ad5f0b182b43a63dda380c1176ac42d2c1011ef1 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 2 Aug 2020 12:25:51 +0200 Subject: [PATCH] Improved modularity of Docker build --- Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0857cf19c..c4cbf3e11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,9 @@ FROM python:3.8.1-alpine3.11 +# Build-time flags +ARG WITH_PLUGINS=true + # Set build directory WORKDIR /tmp @@ -39,11 +42,14 @@ RUN \ openssh \ && apk add --no-cache --virtual .build gcc musl-dev \ && pip install --no-cache-dir . \ - && pip install --no-cache-dir \ - 'mkdocs-awesome-pages-plugin>=2.2.1' \ - 'mkdocs-git-revision-date-localized-plugin>=0.4' \ - 'mkdocs-minify-plugin>=0.3' \ - 'mkdocs-redirects>=1.0' \ + && \ + if [ "${WITH_PLUGINS}" = "true" ]; then \ + pip install --no-cache-dir \ + 'mkdocs-awesome-pages-plugin>=2.2.1' \ + 'mkdocs-git-revision-date-localized-plugin>=0.4' \ + 'mkdocs-minify-plugin>=0.3' \ + 'mkdocs-redirects>=1.0'; \ + fi \ && apk del .build gcc musl-dev \ && rm -rf /tmp/*