Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #
  2. # See the top level Makefile in https://github.com/docker/docker for usage.
  3. #
  4. FROM debian:jessie
  5. MAINTAINER Sven Dowideit <SvenDowideit@docker.com> (@SvenDowideit)
  6. RUN apt-get update \
  7. && apt-get install -y \
  8. gettext \
  9. git \
  10. libssl-dev \
  11. make \
  12. python-dev \
  13. python-pip \
  14. python-setuptools \
  15. vim-tiny
  16. RUN pip install mkdocs
  17. # add MarkdownTools to get transclusion
  18. # (future development)
  19. #RUN easy_install -U setuptools
  20. #RUN pip install MarkdownTools2
  21. # this version works, the current versions fail in different ways
  22. RUN pip install awscli==1.4.4 pyopenssl==0.12
  23. # get my sitemap.xml branch of mkdocs and use that for now
  24. # commit hash of the newest commit of SvenDowideit/mkdocs on
  25. # docker-markdown-merge branch, it is used to break docker cache
  26. # see: https://github.com/SvenDowideit/mkdocs/tree/docker-markdown-merge
  27. RUN git clone -b docker-markdown-merge https://github.com/SvenDowideit/mkdocs \
  28. && cd mkdocs/ \
  29. && git checkout ad32549c452963b8854951d6783f4736c0f7c5d5 \
  30. && ./setup.py install
  31. COPY . /docs
  32. COPY MAINTAINERS /docs/sources/humans.txt
  33. WORKDIR /docs
  34. RUN VERSION=$(cat VERSION) \
  35. && MAJOR_MINOR="${VERSION%.*}" \
  36. && for i in $(seq $MAJOR_MINOR -0.1 1.0); do \
  37. echo "<li><a class='version' href='/v$i'>Version v$i</a></li>"; \
  38. done > sources/versions.html_fragment \
  39. && GIT_BRANCH=$(cat GIT_BRANCH) \
  40. && GITCOMMIT=$(cat GITCOMMIT) \
  41. && AWS_S3_BUCKET=$(cat AWS_S3_BUCKET) \
  42. && BUILD_DATE=$(date) \
  43. && sed -i "s/\$VERSION/$VERSION/g" theme/mkdocs/base.html \
  44. && sed -i "s/\$MAJOR_MINOR/v$MAJOR_MINOR/g" theme/mkdocs/base.html \
  45. && sed -i "s/\$GITCOMMIT/$GITCOMMIT/g" theme/mkdocs/base.html \
  46. && sed -i "s/\$GIT_BRANCH/$GIT_BRANCH/g" theme/mkdocs/base.html \
  47. && sed -i "s/\$BUILD_DATE/$BUILD_DATE/g" theme/mkdocs/base.html \
  48. && sed -i "s/\$AWS_S3_BUCKET/$AWS_S3_BUCKET/g" theme/mkdocs/base.html
  49. EXPOSE 8000
  50. RUN cd sources && rgrep --files-with-matches '{{ include ".*" }}' | xargs sed -i~ 's/{{ include "\(.*\)" }}/cat include\/\1/ge'
  51. CMD ["mkdocs", "serve"]