Add Docker build capability (#9128)

* Add Dockerfile and make commands

* add background run option

* Expand on OSS attribution in new Dockerfile

* Begin adding README instructions for Docker

* Add new stage command
This commit is contained in:
Luc Perkins
2018-06-21 10:13:29 -07:00
committed by k8s-ci-robot
parent 9034e1b2b4
commit f3fb826dc5
3 changed files with 75 additions and 3 deletions
+32 -1
View File
@@ -16,7 +16,38 @@ For more information about contributing to the Kubernetes documentation, see:
* [Using Page Templates](http://kubernetes.io/docs/home/contribute/page-templates/)
* [Documentation Style Guide](http://kubernetes.io/docs/home/contribute/style-guide/)
## Building the site using Docker
If you'd like, you can build the Kubernetes docs using Docker. To get started, build the image locally:
```bash
$ make docker-image
# The underlying command:
$ docker build . \
--tag kubernetes-hugo \
--build-arg HUGO_VERSION=0.40.3
```
You can create an image for a different version of Hugo by changing the value of the `HUGO_VERSION` argument for the build. You *must* specify a version or the image will not build.
Once the `kubernetes-hugo` image has been built locally, you can build the site:
```bash
$ make docker-serve
# The underlying command:
$ docker run \
--rm \
--interactive \
--tty \
--volume $(PWD):/src \
kubernetes-hugo:latest \
hugo
```
As when building without using a Docker container, the results of the build will be published to the `public` directory (the default output directory for [Hugo](https://gohugo.io), the static site generator used to build this site).
## Thank you!
Kubernetes thrives on community participation, and we really appreciate your
contributions to our site and our documentation!
contributions to our site and our documentation!