diff --git a/Makefile b/Makefile index d358678223..e020c14eac 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 d832dcb798..9b968ca847 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 6f396e044a..5371569596 100644 --- a/docs/theme/mkdocs/base.html +++ b/docs/theme/mkdocs/base.html @@ -48,7 +48,7 @@
{% include "breadcrumbs.html" %}
- {% include "beta_warning.html" %} + {% include "version.html" %} {{ content }}
diff --git a/docs/theme/mkdocs/beta_warning.html b/docs/theme/mkdocs/beta_warning.html index 943633e250..b7ffd28a9a 100644 --- a/docs/theme/mkdocs/beta_warning.html +++ b/docs/theme/mkdocs/beta_warning.html @@ -1,3 +1,4 @@ +{% if aws_bucket != "docs.docker.io" %}
-

You are looking at the beta docs for the development version of Docker.

-There is a chance of them being different from the prior versions. +

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 %}