Add script to locally serve MkDocs site through docker
Created by: seancolsen
This is a first stab at using Docker to make it easier for people to preview the Dev Guide locally. I'd like some feedback from others about the idea of including this script in this repo (and potentially other repos like the User Guide). @mickadoo @PalanteJon @ErichBSchulz (Docker fans I know) do any of you have thoughts on this? The idea here is that if someone has git and Docker installed locally then they can run this new script ./docker-mkdocs-serve
to preview the book locally and then edit (without needing to install pip, mkdocs, etc).
Concerns/questions:
- Would this script even be useful to anyone? Maybe not. If they can install git and Docker it's only a small leap to install the other packages. OTOH, I've seen a lot of people have challenges getting MkDocs working locally. Maybe there would be some people who benefit from using this script?
- Is my approach a good one? I'm new to Docker. The goal here is to use Docker to make it easier for people to run
mkdocs serve
, but am I really using Docker the right way here? Not sure about that. Note that there's no Dockerfile here. My approach is to use a custom public image hosted on Docker Hub which I built to have MkDocs and other dependencies that our docs books require.
Merge request reports
Activity
Created by: mickadoo
I'm not sure how to do it, but it would be nice if the public image had a link to the Dockerfile that was used to build it. Otherwise the script is a bit of a black-box.
I think the script is useful for sure. Having just a single step to get everything should definitely help new doc writers along the way.
I can also see the argument for just putting it in the documentation somewhere instead of a script, since it is just one of the option for getting the environment set up. It also might be customized, for example if you want to change the ports that it's listening on.
It would also be good to know how it'll work on Windows (if we're expecting any Windows devs). If we're not catering to everyone then maybe it would be better placed in a setup section as part of the docs.
Created by: seancolsen
@mickadoo thanks for the thoughts. I made some adjustments accordingly:
-
"...would be nice if the public image had a link to the Dockerfile that was used to build it"
- I created an automated build for the Docker image (and changed the command to use that new image instead). This way, when you view the automated build on hub.docker.com you see a link to the GitHub repo used to generate the build.
-
"...can also see the argument for just putting it in the documentation somewhere instead of a script"
- Agreed. Done.
-
"...would also be good to know how it'll work on Windows"
- No progress on this front yet
-
"...would be nice if the public image had a link to the Dockerfile that was used to build it"