improve unix docker run

This commit is contained in:
François Capon 2025-09-01 11:11:23 +02:00 committed by GitHub
parent 1f3c48e5c3
commit e2f332d57f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 3 deletions

View File

@ -10,7 +10,18 @@ mkdocs new .
Alternatively, if you're running Material for MkDocs from within Docker, use: Alternatively, if you're running Material for MkDocs from within Docker, use:
=== "Unix, Powershell"
=== "Unix"
```
docker run --rm \
--user $(id -u):$(id -g) \
--volume $(pwd):/docs \
squidfunk/mkdocs-material \
new . # bootstrap project
```
=== "Powershell"
``` ```
docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material new . docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material new .
@ -210,7 +221,18 @@ mkdocs serve # (1)!
If you're running Material for MkDocs from within Docker, use: If you're running Material for MkDocs from within Docker, use:
=== "Unix, Powershell" === "Unix"
```
docker run --rm \
--user $(id -u):$(id -g) \
--volume $(pwd):/docs \
--publish 127.0.0.1:8000:8000 \
squidfunk/mkdocs-material
# serve by default (Ctrl + C to stop preview server)
```
=== "Powershell"
``` ```
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
@ -241,7 +263,17 @@ mkdocs build
If you're running Material for MkDocs from within Docker, use: If you're running Material for MkDocs from within Docker, use:
=== "Unix, Powershell" === "Unix"
```
docker run --rm \
--user $(id -u):$(id -g) \
--volume $(pwd):/docs \
squidfunk/mkdocs-material \
build # build static site in $(pwd)/site
```
=== "Powershell"
``` ```
docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material build docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material build