Explorar o código

Merge pull request #12508 from Mic92/docs-speedup

docs: speed up build by reducing build steps
moxiegirl %!s(int64=10) %!d(string=hai) anos
pai
achega
2bc3fb5149
Modificáronse 1 ficheiros con 35 adicións e 64 borrados
  1. 35 64
      docs/Dockerfile

+ 35 - 64
docs/Dockerfile

@@ -27,10 +27,7 @@ COPY ./VERSION VERSION
 #COPY ./image/spec/v1.md /docs/sources/reference/image-spec-v1.md
 
 # TODO: don't do this - look at merging the yml file in build.sh
-COPY ./mkdocs.yml mkdocs.yml
-COPY ./s3_website.json s3_website.json
-COPY ./release.sh release.sh
-
+COPY ./mkdocs.yml ./s3_website.json ./release.sh ./
 
 #######################
 # Docker Distribution
@@ -38,32 +35,27 @@ COPY ./release.sh release.sh
 
 #ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/mkdocs.yml /docs/mkdocs-distribution.yml
 
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/images/notifications.png /docs/sources/registry/images/notifications.png
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/images/registry.png /docs/sources/registry/images/registry.png
-
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/overview.md /docs/sources/registry/overview.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/overview.md
-
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/deploying.md /docs/sources/registry/deploying.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/deploying.md
-
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/configuration.md /docs/sources/registry/configuration.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/configuration.md
-
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/storagedrivers.md /docs/sources/registry/storagedrivers.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/storagedrivers.md
+ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/images/notifications.png \
+    https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/images/registry.png \
+  /docs/sources/registry/images/
 
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/notifications.md /docs/sources/registry/notifications.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/notifications.md
+ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/overview.md \
+    https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/deploying.md \
+    https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/configuration.md \
+    https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/storagedrivers.md \
+    https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/notifications.md \
+  /docs/sources/registry/
 
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/spec/api.md /docs/sources/registry/spec/api.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/spec/api.md
-
-ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/spec/json.md /docs/sources/registry/spec/json.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/spec/json.md
+ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/spec/api.md \
+    https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/spec/json.md \
+  /docs/sources/registry/spec/
 
 ADD https://raw.githubusercontent.com/docker/distribution/${DISTRIB_BRANCH}/docs/spec/auth/token.md /docs/sources/registry/spec/auth/token.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/spec/auth/token.md
+
+RUN sed -i.old '1s;^;no_version_dropdown: true;' \
+  /docs/sources/registry/*.md \
+  /docs/sources/registry/spec/*.md \
+  /docs/sources/registry/spec/auth/*.md
 
 #######################
 # Docker Swarm
@@ -71,19 +63,16 @@ RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/registry/spec/aut
 
 #ADD https://raw.githubusercontent.com/docker/swarm/${SWARM_BRANCH}/docs/mkdocs.yml /docs/mkdocs-swarm.yml
 ADD https://raw.githubusercontent.com/docker/swarm/${SWARM_BRANCH}/docs/index.md /docs/sources/swarm/index.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/swarm/index.md
 
 ADD https://raw.githubusercontent.com/docker/swarm/${SWARM_BRANCH}/discovery/README.md /docs/sources/swarm/discovery.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/swarm/discovery.md
 
 ADD https://raw.githubusercontent.com/docker/swarm/${SWARM_BRANCH}/api/README.md /docs/sources/swarm/API.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/swarm/API.md
 
 ADD https://raw.githubusercontent.com/docker/swarm/${SWARM_BRANCH}/scheduler/filter/README.md /docs/sources/swarm/scheduler/filter.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/swarm/scheduler/filter.md
 
 ADD https://raw.githubusercontent.com/docker/swarm/${SWARM_BRANCH}/scheduler/strategy/README.md /docs/sources/swarm/scheduler/strategy.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/swarm/scheduler/strategy.md
+
+RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/swarm/*.md /docs/sources/swarm/scheduler/*.md
 
 #######################
 # Docker Machine
@@ -99,38 +88,20 @@ RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/machine/index.md
 
 #ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/mkdocs.yml /docs/mkdocs-compose.yml
 
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/index.md /docs/sources/compose/index.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/index.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/install.md /docs/sources/compose/install.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/install.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/cli.md /docs/sources/compose/cli.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/cli.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/yml.md /docs/sources/compose/yml.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/yml.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/env.md /docs/sources/compose/env.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/env.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/completion.md /docs/sources/compose/completion.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/completion.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/django.md /docs/sources/compose/django.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/django.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/rails.md /docs/sources/compose/rails.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/rails.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/wordpress.md /docs/sources/compose/wordpress.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/wordpress.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/extends.md /docs/sources/compose/extends.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/extends.md
-
-ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/production.md /docs/sources/compose/production.md
-RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/production.md
+ADD https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/index.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/install.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/cli.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/yml.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/env.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/completion.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/django.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/rails.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/wordpress.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/extends.md \
+  https://raw.githubusercontent.com/docker/compose/${COMPOSE_BRANCH}/docs/production.md \
+  /docs/sources/compose/
+
+RUN sed -i.old '1s;^;no_version_dropdown: true;' /docs/sources/compose/*.md
 
 # Then build everything together, ready for mkdocs
-RUN /docs/build.sh
+RUN /docs/build.sh