Skip to content

Commit

Permalink
Merge pull request #5658 from hellt/user-requirements
Browse files Browse the repository at this point in the history
Added user-requirements.txt install workflow
  • Loading branch information
squidfunk authored Jun 29, 2023
2 parents 80d35bc + eb23f01 commit 2577640
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,6 +66,10 @@ RUN \
"pillow>=9.0" \
"cairosvg>=2.5"; \
fi \
&& \
if [ -e user-requirements.txt ]; then \
pip install -U -r user-requirements.txt; \
fi \
&& \
apk del .build \
&& \
Expand Down
12 changes: 7 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docs/insiders/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2577640

Please sign in to comment.