X Tutup
Skip to content

Commit 80851aa

Browse files
committed
Add the docs.docker.com build tooling
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
1 parent 0a7afa8 commit 80851aa

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,19 @@ validate: validate-dco validate-gofmt
1515

1616
build:
1717
script/build
18+
19+
# import the existing docs build cmds from docker/docker
20+
DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))
21+
DOCSPORT := 8000
22+
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
23+
DOCKER_DOCS_IMAGE := dhe-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
24+
DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE
25+
26+
docs: docs-build
27+
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve
28+
29+
docs-shell: docs-build
30+
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
31+
32+
docs-build:
33+
docker build -t "$(DOCKER_DOCS_IMAGE)" -f docs/Dockerfile .

docs/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM docs/base:latest
2+
MAINTAINER Sven Dowideit <SvenDowideit@docker.com> (@SvenDowideit)
3+
4+
# to get the git info for this repo
5+
COPY . /src
6+
7+
# Reset the /docs dir so we can replace the theme meta with the new repo's git info
8+
RUN git reset --hard
9+
10+
RUN grep VERSION /src/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION
11+
COPY docs/* /docs/sources/machine/
12+
COPY docs/mkdocs.yml /docs/mkdocs-machine.yml
13+
14+
# Then build everything together, ready for mkdocs
15+
RUN /docs/build.sh

docs/mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
- ['machine/dockermachine.md', 'User Guide', 'Docker Machine' ]

0 commit comments

Comments
 (0)
X Tutup