From b38e6a7cbf8e64b077768d31bd39cae13eef0049 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 20 Jun 2023 13:33:17 +0200 Subject: [PATCH 1/3] added user requirements --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 955816966..a0c03d8ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ WORKDIR /tmp COPY material material COPY package.json package.json COPY README.md README.md -COPY requirements.txt requirements.txt +COPY *requirements.txt ./ COPY pyproject.toml pyproject.toml # Perform build and cleanup artifacts and caches @@ -66,6 +66,8 @@ RUN \ "pillow>=9.0" \ "cairosvg>=2.5"; \ fi \ +&& \ + [ -e user-requirements.txt ] && pip install -r user-requirements.txt \ && \ apk del .build \ && \ From aec897302ff6dc9cfa9857e906181da9616d1485 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 21 Jun 2023 18:38:05 +0300 Subject: [PATCH 2/3] added user-provided docs for container packaging --- docs/getting-started.md | 12 +++++++----- docs/insiders/getting-started.md | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index d0ba22475..63ae33b9f 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -117,11 +117,12 @@ The following plugins are bundled with the Docker image: Material for MkDocs only bundles selected plugins in order to keep the size of the official image small. If the plugin you want to use is not included, - create a new `Dockerfile` and extend the official Docker image: + create a `user-requirements.txt` file in the repository root with the packages + you want to install additionally, e.g.: - ``` Dockerfile - FROM squidfunk/mkdocs-material - RUN pip install ... + ``` txt title="user-requirements.txt" + mkdocs-macros-plugin==0.7.0 + mkdocs-glightbox>=0.3.1 ``` Next, you can build the image with the following command: @@ -130,7 +131,8 @@ The following plugins are bundled with the Docker image: docker build -t squidfunk/mkdocs-material . ``` - The new image can be used exactly like the official image. + The new image will have additional packages installed and can be used + exactly like the official image. ### with git diff --git a/docs/insiders/getting-started.md b/docs/insiders/getting-started.md index cb0368bc0..3db39ab10 100644 --- a/docs/insiders/getting-started.md +++ b/docs/insiders/getting-started.md @@ -79,6 +79,9 @@ docker login -u ${GH_USERNAME} -p ${GHCR_TOKEN} ghcr.io docker pull ghcr.io/${GH_USERNAME}/mkdocs-material-insiders ``` +Should you wish to add additional plugins to the insiders container image, follow the steps +outlined in the [Getting Started guide](../getting-started.md#with-docker). + [^2]: Earlier, Insiders provided a dedicated Docker image which was available to all sponsors. On March 21, 2021, the image was deprecated for the reasons From 2333e8b3227b845dfab6c9f03171c73fa4cf37f2 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 26 Jun 2023 09:07:05 +0200 Subject: [PATCH 3/3] add --update when installing deps --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a0c03d8ce..47c2bea90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,7 +67,7 @@ RUN \ "cairosvg>=2.5"; \ fi \ && \ - [ -e user-requirements.txt ] && pip install -r user-requirements.txt \ + [ -e user-requirements.txt ] && pip install -U -r user-requirements.txt \ && \ apk del .build \ && \