mirror of
https://github.com/gluster/glusterdocs.git
synced 2026-02-05 15:47:01 +01:00
Add Dockerfile and Makefile for easily building docs (#614)
This is useful to have - thank you for contributing. @amarts perhaps we can make more folks aware that this is now available. If any changes/fixes are required we can track against this initial contribution.
This commit is contained in:
committed by
GitHub
parent
c0dd8ee8e0
commit
a2ff1f5647
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
site/
|
||||
env/
|
||||
.env
|
||||
/.buildlog
|
||||
|
||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM centos:7
|
||||
|
||||
# RUN yum install -y epel-release
|
||||
RUN yum install -y python3 python3-setuptools
|
||||
RUN pip3 install mkdocs mkdocs-material
|
||||
|
||||
ENV LC_ALL=en_US.utf-8 LANG=en_US.utf-8
|
||||
|
||||
ENTRYPOINT ["mkdocs", "build"]
|
||||
5
Makefile
Normal file
5
Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
build: docker/build
|
||||
@docker run --rm -ti --user $(shell id -u):$(shell id -g) -v $(PWD):/docs:ro -v $(PWD)/site:/docs/site:rw -w /docs $(shell grep "Successfully built" .buildlog | cut -d ' ' -f 3)
|
||||
|
||||
docker/build:
|
||||
@docker build . | tee .buildlog
|
||||
17
README.md
17
README.md
@@ -12,7 +12,7 @@ If you are on EPEL 7 or Fedora, the first thing you will need is to install
|
||||
mkdocs, with the following command :
|
||||
|
||||
# sudo yum install mkdocs
|
||||
|
||||
|
||||
For Fedora 30+ (run the following in root)
|
||||
|
||||
# dnf install python-pip
|
||||
@@ -37,3 +37,18 @@ Then you need to run mkdocs
|
||||
|
||||
The result will be in the `site/` subdirectory, in HTML.
|
||||
|
||||
# Building the docs in Docker
|
||||
|
||||
Included is a Makefile and a Dockerfile, which enables you to easily build the
|
||||
docs inside Docker without installing any dependencies on your system.
|
||||
|
||||
Simply run the following command to compile the docs:
|
||||
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
||||
This Makefile recipe builds a Docker image containing the dependencies required
|
||||
and runs `mkdocs` inside the built image, taking care to run the container as
|
||||
the current `uid` and `gid` so that your user has ownership of the results in
|
||||
the `./site` directory.
|
||||
|
||||
Reference in New Issue
Block a user