From aca424c9c048e53f051d9524a1b1e95d9597cee2 Mon Sep 17 00:00:00 2001 From: Jan Frenzel <jan.frenzel@tu-dresden.de> Date: Thu, 5 Aug 2021 12:43:16 +0200 Subject: [PATCH] Removed volume from Dockerfile; added parameter -p 8000:0000 for serving via docker. --- Dockerfile | 2 -- doc.zih.tu-dresden.de/README.md | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c4c422a5e..d8d77ca7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,4 @@ RUN npm install -g markdownlint-cli markdown-link-check WORKDIR /src/doc.zih.tu-dresden.de -VOLUME ["/docs"] - CMD ["mkdocs", "build", "--verbose"] diff --git a/doc.zih.tu-dresden.de/README.md b/doc.zih.tu-dresden.de/README.md index 801474f2e..9d2948a81 100644 --- a/doc.zih.tu-dresden.de/README.md +++ b/doc.zih.tu-dresden.de/README.md @@ -121,16 +121,23 @@ docker build -t hpc-compendium . ``` If you want to see how it looks in your browser, you can use shell commands to serve -the documentation (first line) and get the URL for your browser's address bar (second line): +the documentation: ```Bash -docker run --name=hpc-compendium --rm -it -w /docs --mount src="$(pwd)"/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium bash -c "mkdocs build --verbose && mkdocs serve -a 0.0.0.0:8000" +docker run --name=hpc-compendium -p 8000:8000 --rm -it -w /docs --mount src="$(pwd)"/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium bash -c "mkdocs build --verbose && mkdocs serve -a 0.0.0.0:8000" +``` + +You can view the documentation via [http://localhost:8000](http://localhost:8000) in your browser, now. + +If that does not work, check if you can get the URL for your browser's address +bar from a different terminal window: +```Bash echo http://$(docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -qf "name=hpc-compendium")):8000 ``` -The first line (with the mount option) automatically takes care of the file changes and rebuilds -the documentation. If you want to check whether the markdown files are formatted properly, use the -following command: +The running container automatically takes care of file changes and rebuilds the +documentation. If you want to check whether the markdown files are formatted +properly, use the following command: ```Bash docker run --name=hpc-compendium --rm -it -w /docs --mount src="$(pwd)"/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium markdownlint docs -- GitLab