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
+13 -2
View File
@@ -1,3 +1,8 @@
DOCKER = docker
HUGO_VERSION = 0.40.3
DOCKER_IMAGE = kubernetes-hugo
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(PWD):/src
.PHONY: all build sass build-preview help serve
help: ## Show this help.
@@ -18,5 +23,11 @@ build-preview: ## Build site with drafts and future posts enabled.
serve: ## Boot the development server.
hugo server
stage: ## This needs to be updated for Hugo
#docker run -ti --rm -v "${PWD}":/k8sdocs -p 4000:4000 gcr.io/google-samples/k8sdocs:1.1
docker-image:
$(DOCKER) build . --tag $(DOCKER_IMAGE) --build-arg HUGO_VERSION=$(HUGO_VERSION)
docker-build:
$(DOCKER_RUN) $(DOCKER_IMAGE) hugo
stage:
$(DOCKER_RUN) -p 1313:1313 $(DOCKER_IMAGE) hugo server --watch --bind 0.0.0.0