diff --git a/Makefile b/Makefile index d35867822349f541581b1f733f9e74da314af784..e020c14eaca237924a85c1f6602bceb9d59f4f29 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,9 @@ build: bundles docker build -t "$(DOCKER_IMAGE)" . docs-build: + cp ./VERSION docs/VERSION + echo "$(GIT_BRANCH)" > docs/GIT_BRANCH + echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET docker build -t "$(DOCKER_DOCS_IMAGE)" docs bundles: diff --git a/docs/Dockerfile b/docs/Dockerfile index d832dcb79852891d9b9564b9e48033c683180c3b..9b968ca84777a32334586e863b43a82c2050b926 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -39,6 +39,11 @@ WORKDIR /docs #convert to markdown #RUN ./convert.sh +RUN VERSION=$(cat /docs/VERSION) &&\ + GIT_BRANCH=$(cat /docs/GIT_BRANCH) &&\ + AWS_S3_BUCKET=$(cat /docs/AWS_S3_BUCKET) &&\ + echo "{% set docker_version = \"${VERSION}\" %}{% set docker_branch = \"${GIT_BRANCH}\" %}{% set aws_bucket = \"${AWS_S3_BUCKET}\" %}{% include \"beta_warning.html\" %}" > /docs/theme/mkdocs/version.html + # note, EXPOSE is only last because of https://github.com/dotcloud/docker/issues/3525 EXPOSE 8000 diff --git a/docs/theme/mkdocs/base.html b/docs/theme/mkdocs/base.html index 766afc0c8aefc86243f8f5b8dc112ca4014a73f5..53715695963f7cebdfdfbb073a5eb633e6824a47 100644 --- a/docs/theme/mkdocs/base.html +++ b/docs/theme/mkdocs/base.html @@ -48,6 +48,7 @@
{% include "breadcrumbs.html" %}
+ {% include "version.html" %} {{ content }}
diff --git a/docs/theme/mkdocs/beta_warning.html b/docs/theme/mkdocs/beta_warning.html new file mode 100644 index 0000000000000000000000000000000000000000..b7ffd28a9a2dd41f7add52b2cde74a0f4fcbd48f --- /dev/null +++ b/docs/theme/mkdocs/beta_warning.html @@ -0,0 +1,32 @@ +{% if aws_bucket != "docs.docker.io" %} + +
+

This is the + {% if docker_version != docker_version|replace("-dev", "bingo") %}{{ docker_branch }} development branch{% else %}beta{% endif %} + documentation for Docker version {{ docker_version }}.

+ Please go to http://docs.docker.io for the current Docker release documentation. + {{ aws_bucket }} +
+{% endif %}