|
1 | 1 | FROM starefossen/github-pages |
2 | 2 |
|
| 3 | +# Basic Git set-up for throwaway commits |
| 4 | +RUN git config --global user.email "gordon@docker.com" |
| 5 | +RUN git config --global user.name "Gordon" |
| 6 | + |
| 7 | +# Clone the docs repo |
3 | 8 | RUN git clone https://www.github.com/docker/docker.github.io allv |
| 9 | + |
| 10 | +# Get docker/docker ref docs from 1.12.x branch to be used in master builds |
| 11 | +# Uses Github Subversion gateway to limit the checkout |
| 12 | +RUN svn co https://github.com/docker/docker/branches/1.12.x/docs/reference allv/engine/reference |
| 13 | +RUN svn co https://github.com/docker/docker/branches/1.12.x/docs/extend allv/engine/extend |
| 14 | +# Can't use the svn trick to get a single file, use wget instead |
| 15 | +RUN wget -O allv/engine/deprecated.md https://raw.githubusercontent.com/docker/docker/1.12.x/docs/deprecated.md |
| 16 | +# Make a temporary commit for the files we added so we can check out other branches later |
| 17 | +RUN git --git-dir=./allv/.git --work-tree=./allv add engine |
| 18 | +RUN git --git-dir=./allv/.git --work-tree=./allv commit -m "Temporary commit" |
| 19 | + |
| 20 | +# Create HTML for master |
4 | 21 | RUN jekyll build -s allv -d allvbuild |
5 | 22 |
|
| 23 | +# Check out 1.4 branch, create HTML, tweak links |
6 | 24 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.4 |
7 | 25 | RUN mkdir allvbuild/v1.4 |
8 | 26 | RUN jekyll build -s allv -d allvbuild/v1.4 |
9 | 27 | RUN find allvbuild/v1.4 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.4/#g' |
10 | 28 | RUN find allvbuild/v1.4 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.4/#g' |
11 | 29 | RUN find allvbuild/v1.4 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.4/#g' |
12 | 30 |
|
| 31 | +# Check out 1.5 branch, create HTML, tweak links |
13 | 32 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.5 |
14 | 33 | RUN mkdir allvbuild/v1.5 |
15 | 34 | RUN jekyll build -s allv -d allvbuild/v1.5 |
16 | 35 | RUN find allvbuild/v1.5 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.5/#g' |
17 | 36 | RUN find allvbuild/v1.5 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.5/#g' |
18 | 37 | RUN find allvbuild/v1.5 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.5/#g' |
19 | 38 |
|
| 39 | +# Check out 1.6, create HTML, tweak links |
20 | 40 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.6 |
21 | 41 | RUN mkdir allvbuild/v1.6 |
22 | 42 | RUN jekyll build -s allv -d allvbuild/v1.6 |
23 | 43 | RUN find allvbuild/v1.6 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.6/#g' |
24 | 44 | RUN find allvbuild/v1.6 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.6/#g' |
25 | 45 | RUN find allvbuild/v1.6 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.6/#g' |
26 | 46 |
|
| 47 | +# Check out 1.7, create HTML, tweak links |
27 | 48 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.7 |
28 | 49 | RUN mkdir allvbuild/v1.7 |
29 | 50 | RUN jekyll build -s allv -d allvbuild/v1.7 |
30 | 51 | RUN find allvbuild/v1.7 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.7/#g' |
31 | 52 | RUN find allvbuild/v1.7 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.7/#g' |
32 | 53 | RUN find allvbuild/v1.7 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.7/#g' |
33 | 54 |
|
| 55 | +# Check out 1.8, create HTML, tweak links |
34 | 56 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.8 |
35 | 57 | RUN mkdir allvbuild/v1.8 |
36 | 58 | RUN jekyll build -s allv -d allvbuild/v1.8 |
37 | 59 | RUN find allvbuild/v1.8 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.8/#g' |
38 | 60 | RUN find allvbuild/v1.8 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.8/#g' |
39 | 61 | RUN find allvbuild/v1.8 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.8/#g' |
40 | 62 |
|
| 63 | +# Check out 1.9, create HTML, tweak links |
41 | 64 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.9 |
42 | 65 | RUN mkdir allvbuild/v1.9 |
43 | 66 | RUN jekyll build -s allv -d allvbuild/v1.9 |
44 | 67 | RUN find allvbuild/v1.9 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.9/#g' |
45 | 68 | RUN find allvbuild/v1.9 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.9/#g' |
46 | 69 | RUN find allvbuild/v1.9 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.9/#g' |
47 | 70 |
|
| 71 | +# Check out 1.10, create HTML, tweak links |
48 | 72 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.10 |
49 | 73 | RUN mkdir allvbuild/v1.10 |
50 | 74 | RUN jekyll build -s allv -d allvbuild/v1.10 |
51 | 75 | RUN find allvbuild/v1.10 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.10/#g' |
52 | 76 | RUN find allvbuild/v1.10 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.10/#g' |
53 | 77 | RUN find allvbuild/v1.10 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.10/#g' |
54 | 78 |
|
| 79 | +# Check out 1.11, create HTML, tweak links |
55 | 80 | RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.11 |
56 | 81 | RUN mkdir allvbuild/v1.11 |
57 | 82 | RUN jekyll build -s allv -d allvbuild/v1.11 |
58 | 83 | RUN find allvbuild/v1.11 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.11/#g' |
59 | 84 | RUN find allvbuild/v1.11 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.11/#g' |
60 | 85 | RUN find allvbuild/v1.11 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/v1.11/#g' |
61 | 86 |
|
| 87 | +# Serve the site, which is now all static HTML |
62 | 88 | CMD jekyll serve -s /usr/src/app/allvbuild -d /_site --no-watch -H 0.0.0.0 -P 4000 |
0 commit comments