|
1 | 1 | FROM starefossen/github-pages
|
2 | 2 |
|
3 |
| -RUN git clone https://www.github.com/docker/docker.github.io allv |
4 |
| -RUN jekyll build -s allv -d allvbuild |
5 |
| - |
6 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.4 |
7 |
| -RUN mkdir allvbuild/v1.4 |
8 |
| -RUN jekyll build -s allv -d allvbuild/v1.4 |
9 |
| -RUN find allvbuild/v1.4 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.4/#g' |
10 |
| -RUN find allvbuild/v1.4 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.4/#g' |
11 |
| -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 |
| - |
13 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.5 |
14 |
| -RUN mkdir allvbuild/v1.5 |
15 |
| -RUN jekyll build -s allv -d allvbuild/v1.5 |
16 |
| -RUN find allvbuild/v1.5 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.5/#g' |
17 |
| -RUN find allvbuild/v1.5 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.5/#g' |
18 |
| -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 |
| - |
20 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.6 |
21 |
| -RUN mkdir allvbuild/v1.6 |
22 |
| -RUN jekyll build -s allv -d allvbuild/v1.6 |
23 |
| -RUN find allvbuild/v1.6 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.6/#g' |
24 |
| -RUN find allvbuild/v1.6 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.6/#g' |
25 |
| -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 |
| - |
27 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.7 |
28 |
| -RUN mkdir allvbuild/v1.7 |
29 |
| -RUN jekyll build -s allv -d allvbuild/v1.7 |
30 |
| -RUN find allvbuild/v1.7 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.7/#g' |
31 |
| -RUN find allvbuild/v1.7 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.7/#g' |
32 |
| -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 |
| - |
34 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.8 |
35 |
| -RUN mkdir allvbuild/v1.8 |
36 |
| -RUN jekyll build -s allv -d allvbuild/v1.8 |
37 |
| -RUN find allvbuild/v1.8 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.8/#g' |
38 |
| -RUN find allvbuild/v1.8 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.8/#g' |
39 |
| -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 |
| - |
41 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.9 |
42 |
| -RUN mkdir allvbuild/v1.9 |
43 |
| -RUN jekyll build -s allv -d allvbuild/v1.9 |
44 |
| -RUN find allvbuild/v1.9 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.9/#g' |
45 |
| -RUN find allvbuild/v1.9 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.9/#g' |
46 |
| -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 |
| - |
48 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.10 |
49 |
| -RUN mkdir allvbuild/v1.10 |
50 |
| -RUN jekyll build -s allv -d allvbuild/v1.10 |
51 |
| -RUN find allvbuild/v1.10 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.10/#g' |
52 |
| -RUN find allvbuild/v1.10 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.10/#g' |
53 |
| -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 |
| - |
55 |
| -RUN git --git-dir=./allv/.git --work-tree=./allv checkout v1.11 |
56 |
| -RUN mkdir allvbuild/v1.11 |
57 |
| -RUN jekyll build -s allv -d allvbuild/v1.11 |
58 |
| -RUN find allvbuild/v1.11 -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/v1.11/#g' |
59 |
| -RUN find allvbuild/v1.11 -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/v1.11/#g' |
60 |
| -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 |
| - |
62 |
| -CMD jekyll serve -s /usr/src/app/allvbuild -d /_site --no-watch -H 0.0.0.0 -P 4000 |
| 3 | +ENV VERSIONS="v1.4 v1.5 v1.6 v1.7 v1.8 v1.9 v1.10 v1.11" |
| 4 | + |
| 5 | +# Create archive; check out each version, create HTML, tweak links |
| 6 | +RUN git clone https://www.github.com/docker/docker.github.io temp; \ |
| 7 | + for VER in $VERSIONS; do \ |
| 8 | + git --git-dir=./temp/.git --work-tree=./temp checkout ${VER} \ |
| 9 | + && mkdir -p allvbuild/${VER} \ |
| 10 | + && jekyll build -s temp -d allvbuild/${VER} \ |
| 11 | + && find allvbuild/${VER} -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/'"$VER"'/#g' \ |
| 12 | + && find allvbuild/${VER} -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/'"$VER"'/#g' \ |
| 13 | + && find allvbuild/${VER} -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/'"$VER"'/#g'; \ |
| 14 | + done; \ |
| 15 | + rm -rf temp |
| 16 | + |
| 17 | +COPY . allv |
| 18 | + |
| 19 | +## Branch to pull from, per ref doc |
| 20 | +ENV ENGINE_BRANCH="1.13.x" |
| 21 | +ENV DISTRIBUTION_BRANCH="release/2.5" |
| 22 | + |
| 23 | +# The statements below pull reference docs from upstream locations, |
| 24 | +# then build the whole site to static HTML using Jekyll |
| 25 | + |
| 26 | +RUN svn co https://github.com/docker/docker/branches/$ENGINE_BRANCH/docs/extend allv/engine/extend \ |
| 27 | + && wget -O allv/engine/deprecated.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/deprecated.md \ |
| 28 | + && svn co https://github.com/docker/distribution/branches/$DISTRIBUTION_BRANCH/docs/spec allv/registry/spec \ |
| 29 | + && wget -O allv/registry/configuration.md https://raw.githubusercontent.com/docker/distribution/$DISTRIBUTION_BRANCH/docs/configuration.md \ |
| 30 | + && rm -rf allv/apidocs/cloud-api-source \ |
| 31 | + && rm -rf allv/tests \ |
| 32 | + && wget -O allv/engine/api/v1.25/swagger.yaml https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/api/swagger.yaml \ |
| 33 | + && jekyll build -s allv -d allvbuild \ |
| 34 | + && find allvbuild/engine/reference -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/#g' \ |
| 35 | + && find allvbuild/engine/extend -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/#g' \ |
| 36 | + && rm -rf allv |
| 37 | + |
| 38 | +# Serve the site, which is now all static HTML |
| 39 | +CMD jekyll serve -s /usr/src/app/allvbuild --no-watch -H 0.0.0.0 -P 4000 |
0 commit comments