Commit Graph

460 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 6728abcd38
Dockerfile: fix duplicate WORKDIR, and source COPY for update-modules stage
I noticed that building the "vendor" target was copying the source twice;
once in the "build-base" stage, and once in the "update-modules" stage:

    docker buildx bake --set vendor.args.MODULE=github.com/docker/cli vendor
    ...
    => [build-base 1/3] COPY --from=hugo /go/bin/hugo /bin/hugo                 0.2s
    => [build-base 2/3] COPY --from=node /src/node_modules /src/node_modules    1.6s
    => [build-base 3/3] COPY . .                                                3.1s
    => [update-modules 1/4] WORKDIR /src                                        0.0s
    => [update-modules 2/4] COPY . .                                            5.0s
    => [update-modules 3/4] RUN hugo mod get -u                                14.1s
    => [update-modules 4/4] RUN hugo mod vendor                                17.3s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-12-11 22:46:07 +01:00
David Karlsson 1fdb2e77d4 fix: broken glob path for lint job
Linting was only running on a subset of our Markdown files in `content`.
This change fixes the glob path, and adds appropriate exclude paths.
Because the glob pattern was incorrect before, we had lots of files that
didn't comply with the linting rules. This commit also fixes those
issues.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-11-04 10:50:02 +01:00
David Karlsson 18cdb02ece lint: pin markdownlint-cli2 version to v0.10.0
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-11-04 10:50:02 +01:00
David Karlsson ae5350af10 ci: fix validate-upstream workflow
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-10-16 17:25:10 +02:00
David Karlsson b758af9775 lint: add check for missing link definitions
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-09-16 21:41:48 +02:00
David Karlsson 1b8a23cfdd
Merge pull request #18008 from dvdksn/modules-vendor-bake
chore: add vendor target for bake
2023-08-23 20:25:59 +02:00
David Karlsson 9543cd0db5 chore: add vendor target for bake
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-23 16:23:00 +02:00
David Karlsson c379bec61b contribute: update to use compose watch
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-23 15:42:54 +02:00
David Karlsson 0609289f6e release: dont use absolute path to hugo binary
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-22 21:51:03 +02:00
David Karlsson f0eed66f76 release: force npm cache clean
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-22 21:50:37 +02:00
David Karlsson a0d21ade2f migrate to hugo
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-22 09:41:02 +02:00
Guillaume Lours b92ebe5fbf
Replace docker-compose calls (#17881)
* use 'docker compose' instead of 'docker-compose' in Swarm documentation

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>

* replace old usages of 'docker-compose' by 'docker compose'

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>

---------

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-08-08 10:05:39 +01:00
David Karlsson 2d44be0fc0 ci: replace htmlproofer with wjdp/htmltest
Signed-off-by: David Karlsson <david.karlsson@docker.com>
2023-04-12 15:38:51 +02:00
CrazyMax 27f7130024
Dockerfile: remove htmlproofer workaround for buildx_build
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-13 15:25:37 +01:00
Sebastiaan van Stijn a7b9985e00
engine: update reference docs (yaml), and fix anchor links
The updated version uses new anchors for flags, so updates are needed
elsewhere to update those anchors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-09 10:29:43 +01:00
Sebastiaan van Stijn e19b56d856
htmlproofer: temporarily exclude engine/commandline/cli
This page will be updated once the associated PR in docker/cli is merged.
Excluding it until then.

    Running ["LinkCheck", "ImageCheck", "ScriptCheck"] on ["./_site"] on *.html...

    Ran on 2173 files!

    - ./_site/engine/reference/commandline/cli/index.html
      *  linking to internal hash #format-the-output that does not exist (line 314)
         <a href="/engine/reference/commandline/config_ls/#format-the-output"><strong>format the output</strong> section in the  documentation</a>
      *  linking to internal hash #format-the-output that does not exist (line 318)
         <a href="/engine/reference/commandline/images/#format-the-output"><strong>format the output</strong> section in the  documentation</a>
      *  linking to internal hash #format-the-output that does not exist (line 334)
         <a href="/engine/reference/commandline/secret_ls/#format-the-output"><strong>format the output</strong> section in the  documentation</a>
      *  linking to internal hash #formatting that does not exist (line 326)
         <a href="/engine/reference/commandline/plugin_ls/#formatting"><strong>formatting</strong> section in the  documentation</a>
      *  linking to internal hash #formatting that does not exist (line 322)
         <a href="/engine/reference/commandline/node_ls/#formatting"><strong>formatting</strong> section in the  documentation</a>
      *  linking to internal hash #formatting that does not exist (line 330)
         <a href="/engine/reference/commandline/ps/#formatting"><strong>formatting</strong> section in the  documentation</a>
      *  linking to internal hash #formatting that does not exist (line 338)
         <a href="/engine/reference/commandline/service_inspect/#formatting"><strong>formatting</strong> section in the  documentation</a>
      *  linking to internal hash #formatting that does not exist (line 342)
         <a href="/engine/reference/commandline/service_ls/#formatting"><strong>formatting</strong> section in the  documentation</a>
      *  linking to internal hash #formatting that does not exist (line 346)
         <a href="/engine/reference/commandline/stats/#formatting"><strong>formatting</strong> section in the  documentation</a>

    HTML-Proofer found 9 failures!

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-07 13:41:19 +01:00
Sebastiaan van Stijn 1af8b42db8
htmlproofer: temporarily exclude buildx build
The buildx build docs refers to anchors that are being updated,
but are maintained in a separate repository; exclude that page
from the validator until the anchor changes are live and the
buildx docs updated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-07 13:41:16 +01:00
CrazyMax df4abc6472
jekyll: enforce ruby platform to compile gems with native extensions from source
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-11-04 19:16:13 +01:00
CrazyMax 4544982b55
jekyll(last_modified_at): fix for remote resources and data files (#15998)
* Dockerfile: add option to enforce git log history for local dev

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>

* jekyll(last_modified_at): do not override if already set with frontmatter

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>

* jekyll(last_modified_at): use data files for commands reference instead of stub file

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>

* fix broken links

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-31 09:01:42 +01:00
CrazyMax 0001d960fa
Merge pull request #15267 from crazy-max/fix-sitemap-lastmod
jekyll: fix sitemap lastmod
2022-10-26 19:55:23 +02:00
CrazyMax 06908b36f5
jekyll: use git to fetch remote resources
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-26 06:12:36 +02:00
Craig Osterhout 2551e2481a
Update Dockerfile
Attempt to fix deploy issue
2022-10-25 15:25:44 -07:00
CrazyMax 897e77c647
add hotjar for staging environment
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-25 20:21:47 +02:00
David Karlsson 8f77e55567 rename master -> main 2022-10-19 15:52:14 +02:00
CrazyMax 561118ec5b
rename docs repository
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-29 11:07:53 +02:00
Justin Chadwell ebd4a33866 Add linting information to CONTRIBUTING.md
This adds information on how the docs use linting, and more detailed
instructions on how to enable it in an IDE, using VSCode as a concrete
and widespread example.

Additionally, to do this, we add a duplicate style config for
markdownlint in JSON format for the Node.js implementation of
markdownlint that is used by various editor plugins. These both
implement the same core set of warnings, and appear to function
identically.
2022-08-03 09:58:01 +01:00
Justin Chadwell 0fb1ca91e6 ci: add annotations for mdl and htmlproofer
Add GitHub Actions annotations that will appear in the CI checks - this
should make it easier to see the reasons for the linting failures,
without needing to deep dive into the logs.
2022-08-03 09:58:01 +01:00
Usha Mandya dfa7fc3b8e
Merge pull request #15227 from jedevc/linting-fixup
Fix linting 🎉
2022-08-02 17:35:10 +01:00
CrazyMax d2fca0eb8e
jekyll: move relative URLs fix from Dockerfile to Jekyll plugin
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-28 21:17:02 +02:00
CrazyMax 614c4a7000
jekyll: enable sitemap and local search for dev environment
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-28 19:30:46 +02:00
CrazyMax 01a9362d76
jekyll: fix not expanded DOMAIN env
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-28 15:37:04 +02:00
Justin Chadwell 82c7362754 lint: fix linting to base state 2022-07-28 11:27:10 +01:00
CrazyMax 9c296afa3e
switch to ruby markdownlint and add ci validation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-25 12:17:09 +02:00
CrazyMax 76ab23f915
Bump ruby from 2.6.10 to 2.7.6
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-25 01:03:35 +02:00
CrazyMax 2120bd105d
jekyll: create plugin to update api toc
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-18 18:20:31 +02:00
CrazyMax b65866f2a6
jekyll: create plugin to fetch remote resources
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-18 18:20:31 +02:00
CrazyMax 8da7d9445d
dockerfile: containerized htmlproofer
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-13 22:07:58 +02:00
CrazyMax ebd36f7081
dockerfile: enhanced to match netlify pipeline
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-13 22:07:57 +02:00
Guillaume Tardif 82f77a9064
Include extensions-sdk docs from upstream repo (#14658)
* First inclusion of extensions-sdk docs from upstream repo

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>

* Mark extension as Beta, not Preview

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2022-05-04 12:44:44 +01:00
Sebastiaan van Stijn 688134003d
Use 20.10 release branch for upstream engine resources
The 20.10 release branch now exists, and "master" will be used for
Docker Engine 21.xx development.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-25 12:54:54 +01:00
Guillaume Tardif cd5bc70940 Include ACI/ECS reference docs from compose-cli and make them easier to find for docker users
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-04 16:16:12 +01:00
Sebastiaan van Stijn 3ed7250644
Update engine reference for 20.10 release
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-09 00:50:04 +01:00
Sebastiaan van Stijn 332ce64398
Disable search auto-complete in development environment
As we don't generate a metadata.json, auto-complete is non-functional,
so disabling the script for previews.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-23 15:22:55 +02:00
Sebastiaan van Stijn 9b79a27ab4
Dockerfile: output Jekyll profile information
Also skip updating sitemap.xml for the development environment.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-23 13:35:12 +02:00
Sebastiaan van Stijn 5a1ae8310f
Separate "development" and "production" configurations
This patch updates the default configuration to match a "development"
situation, and introduces build-options to produce a "production"
build.

By default (dev environment):

- Google Analytics / GTM and PollDaddy are disabled
- SASS builds non-minified stylesheets (for easier readabililty)
- Excludes "enterprise" stubs

Building a "production" build locally is still possible by overriding
the `JEKYLL_ENV` build-arg;

    JEKYLL_ENV=production docker-compose  up --build

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-22 15:41:15 +02:00
Sebastiaan van Stijn cafd5a9943
Use full URLs for canonical links
Canonical links are expected to be full URLs, not relative.

For this to work, the Dockerfile had to be updated, because we're stripping
the domain-name from links ("<a href..."), but the script currently also included
"<link rel='canonical' .." tags.

With the change, canonical links are left alone;

These hrefs will be replaced

    echo '<a class=foo href="https://docs.docker.com/foo">hello</a>' | sed -e 's#\(<a[^>]* href="\)https://docs.docker.com/#\1/#g'
    # <a class=foo href="/foo">hello</a>
    echo '<a href="https://docs.docker.com/foo">hello</a>' | sed -e 's#\(<a[^>]* href="\)https://docs.docker.com/#\1/#g'
    # <a href="/foo">hello</a>

But, for example, this one is left alone

    echo '<link rel="canonical" href="https://docs.docker.com/foo/bar" />' | sed -e 's#\(<a[^>]* href="?\)https://docs.docker.com/#\1/#g'
    # <link rel="canonical" href="https://docs.docker.com/foo/bar" />

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-12 13:09:32 +02:00
Sebastiaan van Stijn 29546c24f3
Use absolute URLs in sitemap.xml
We generate the website with relative URLs to allow hosting the content
on preview domains.

However, the sitemap.xml should always contain absolute URLs (including
the domain name).

I couldn't find a way to configure the sitemap URL's separately, so using
the same hack we use for stripping URL's in the HTML.

Before this, the sitemap.xml would contain;

    <url>
        <loc>/engine/reference/commandline/volume_prune/</loc>
    </url>

After this, the full URL is included

    <url>
        <loc>https://docs.docker.com/engine/reference/commandline/volume_prune/</loc>
    </url>

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-25 17:47:34 +02:00
Sebastiaan van Stijn ba85012f47
Remove scripts and assets related to archives
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-24 13:25:58 +02:00
Sebastiaan van Stijn 3f7cab652d
Dockerfile: disable archives by default
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-24 13:25:54 +02:00
Sebastiaan van Stijn 2f2ce53a51
Dockerfile: update to gh-pages 198
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-15 22:44:44 +01:00
Sebastiaan van Stijn b7d91ae175
Dockerfile: use alpine for fetching external resources
This step does not depend on Jekyll, so using a minimal
base-image.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-15 22:43:11 +01:00
Sebastiaan van Stijn 07d410de21
Dockerfile: fix links in same step as generating the files
For intermediate stages, it's generally ok to perform steps
separately, however in this case, fixing the links would
happen every time the HTML was generated, so we might as
well do it in the same step, to reduce the size of the local
build cache, as it was adding 54MB for each rebuild:

    IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
    7d97d86ae290        3 minutes ago       RUN /bin/sh -c find ${TARGET} -type f -name …   53.7MB              buildkit.dockerfile.v0
    <missing>           3 minutes ago       RUN /bin/sh -c jekyll build -d ${TARGET} # b…   375MB               buildkit.dockerfile.v0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-15 18:25:30 +01:00
Sebastiaan van Stijn 20267e58b9
prevent fetching resources when updating _config.yml or toc.yaml
The "fetch-upstream-resources" script also updated the toc.yaml,
based on values in the _config.yml.

As a result, any change in either the "_config.yml" or "toc.yaml"
would also result in the upstream resources to be fetched again.

This patch separates the step to update the toc, so that the
upstream resources can be cached. This _does_ mean that remote
sources can get outdated (only will be rebuilt when changing
ENGINE_BRANCH or DISTRIBUTION_BRANCH). That should not be a
problem for actual deployments, which don't use caching.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-28 14:18:17 +01:00
Sebastiaan van Stijn ab9fe6e98e
Dockerfile: remove "deploybase" stage, and inline instead
The "deploybase" stage was only used for the final stage.

This patch inlines the steps from that stage to the final stage
itself. In the process, changing the order of copying the NGINX
configuration file to _after_ the docs were copied. This prevents
having to copy the archived docs when making a change in the NGINX
configuration. The NGINX configuration file _will_ now be copied
on each rebuild, but the file is small, and as such is still faster
than copying all archives.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-28 14:17:20 +01:00
Sebastiaan van Stijn 40e5ab6009
Dockerfile: don't use intermediate "deploy-source" stage
The "deploy-source" stage was added in a previous refactor. While
this stage is useful to "export" all docs (including archives if
needed), and _convenient_ to collect all those files to the final
stage, it caused a regression in performance.

This patch changes the final ("deploy") to copy the "archives" and
"current" docs separately, so that the archived versions can be
cached in the final stage, and don't have to be copied again on
each rebuild.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-28 14:17:18 +01:00
Sebastiaan van Stijn 7d22d25adf
fetch-upstream-resources: simplify parsing of _config.yml
This part of the script was setting variables for any "_version"
property in the configuration file.

We (currently) only need the engine API version, so simplifying
the code to just do that, and fix some spaces -> tabs indentations.

With this change the script only uses standard (POSIX) scripting,
so switching to use the standard (/bin/sh) shell.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-28 14:17:11 +01:00
Usha Mandya f6b590cbb3
Merge pull request #10351 from thaJeztah/use_local_nginx_conf
Dockerfile: use local nginx configuration
2020-02-25 17:35:59 +00:00
Sebastiaan van Stijn 1763c42608
Dockerfile: use local nginx configuration
The docs/docker.github.io:nginx-onbuild has not been
updated for a while, and having a local file present
allows for easier updating it (for example, to add
wildcard redirects).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 18:33:10 +01:00
Sebastiaan van Stijn c78b3bee78
Reduce list of archives to supported enterprise versions
Docker Enterprise actively supports the 17.06, 18.03, 18.09, and
19.03 versions, with 17.06 and 18.03 reaching EOL soon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 17:15:22 +01:00
Sebastiaan van Stijn f2d5f959bc
Dockerfile: add note/todo about use of "toc" and "config"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 13:15:09 +01:00
Sebastiaan van Stijn 1f7d4ce871
Remove "svn" env-vars for branches
Don't require these to be set upfront, as we can create them
locally in the fetch-upstream-resources.sh script

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 13:15:03 +01:00
Sebastiaan van Stijn 1c82d140f7
Dockerfile: fix value for ENGINE_BRANCH
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 13:15:01 +01:00
Sebastiaan van Stijn c8b335c3b8
Dockerfile: add target to output the generated HTML
This patch adds a stage that only contains the generated files. It can
be used to export the generated HTML for hosting the documentation on a
non-containerised service (e.g. to deploy to an s3 bucket).

When using BuildKit, use the `--output` option to build the files and to
copy them to your local filesystem.

For example, to build current docs, including archives:

    DOCKER_BUILDKIT=1 docker build --target=deploy-source --output=./_site .

And to build without archives:

    DOCKER_BUILDKIT=1 docker build --target=deploy-source --build-arg ENABLE_ARCHIVES=false --output=./_site .

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-21 10:51:14 +01:00
Sebastiaan van Stijn 136a8d3f96
Dockerfile: allow building docs without archives
This adds a `ENABLE_ARCHIVES` build-arg, which allows building
the documentation without archives.

Note that currently, the archives drop-down is still added
unconditionally (so also included if archives are disabled).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-21 10:51:11 +01:00
Sebastiaan van Stijn a6a470e4e9
Dockerfile: use "from scratch" image to collect archives
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-21 10:51:09 +01:00
Sebastiaan van Stijn 9b47229953
Remove script and build-stage for fetching library samples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-04 00:03:10 +02:00
Sebastiaan van Stijn 9d90e6514b
Dockerfile: add temporary stage to export library-samples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-04 00:00:23 +02:00
Sebastiaan van Stijn f9f5f8dacd
Convert library samples to stubs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-03 23:03:51 +02:00
Ally Smith 736d2c76be 3.0 release configs (#9086)
edit configs for 3.0 release
2019-07-22 17:42:56 +01:00
Sebastiaan van Stijn 573af666e4
Move fetching "library samples" to a separate stage
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-07 16:27:20 +01:00
Sebastiaan van Stijn c7b9a54df9
Dockerfile: fix missing "boilerplate.txt" in build-stage
Although the docs still rendered ok, some pieces were missing
when generating the "samples", which resulted in warnings during
build:

```
Adding front-matter to ./_samples/library/rethinkdb/README.md ...
cat: can't open './_samples/boilerplate.txt': No such file or directory
Adding front-matter to ./_samples/library/tomcat/README.md ...
cat: can't open './_samples/boilerplate.txt': No such file or directory
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-07 15:15:13 +01:00
Sebastiaan van Stijn 7729a83889
Dockerfile: optimize for caching
The implementation of the Dockerfile first copied the current
version of the documentation, to be followed by fetching upstream
resources, and adding the archived documentation.

As a result, the build-cache was "busted" on every change that was
made locally, causing a full rebuild of both "fetching upstream resources",
building the reference documentation, and generating the archived
versions of the documentation.

With the changes made to the "fetch-upstream-resources.sh" script,
it's now possible to build those docs in advance (in a separate build-
stage), and append the pre-built docs _after_ the current version
of the documentation was built.

This patch updates the Dockerfile to build reference-docs and
archived docs in separate build-stages, optimizing the build for
caching (wich the assumption that no changes are made in upstream
resources between builds). Not only caused this builds to take longer
than needed, but each rebuild also caused new "dangling" images to
be created (in case of the "classic" builder), or new build-caches
to be created (when using BuildKit).

Note that when _deploying_ the documentation, no caching should be
used (to enforce a full rebuild of the documentation, and guarantee
that reference-docs are "fresh").

Before this change, rebuilding the documentation (after a previous
build, so with cache present) took ~185 seconds;

```
docker build -t docs .

[+] Building 184.7s (26/26) FINISHED

 => [builder 2/5] COPY . md_source                                                                                                                                                                                                    2.8s
 => [builder 3/5] RUN bash ./md_source/_scripts/fetch-upstream-resources.sh md_source                                                                                                                                                52.7s
 => [builder 4/5] RUN jekyll build -s md_source -d /usr/share/nginx/html --config md_source/_config.yml                                                                                                                             113.0s
 => [builder 5/5] RUN find /usr/share/nginx/html -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done                                                      4.4s
 => CACHED [stage-1 2/8] COPY --from=docs/docker.github.io:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf                                                                                                0.0s
 => CACHED [stage-1 3/8] COPY --from=docs/docker.github.io:v17.03 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                         0.0s
 => CACHED [stage-1 4/8] COPY --from=docs/docker.github.io:v17.06 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                         0.0s
 => CACHED [stage-1 5/8] COPY --from=docs/docker.github.io:v17.09 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                         0.0s
 => CACHED [stage-1 6/8] COPY --from=docs/docker.github.io:v17.12 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                         0.0s
 => CACHED [stage-1 7/8] COPY --from=docs/docker.github.io:v18.03 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                         0.0s
 => [stage-1 8/8] COPY --from=builder /usr/share/nginx/html /usr/share/nginx/html                                                                                                                                                     3.7s
 => exporting to image                                                                                                                                                                                                                5.1s
 => => exporting layers                                                                                                                                                                                                               5.1s
 => => writing image sha256:70f77631001bd0271455f893b87dd75a1fd6f5db84a00feb8afe5ddf5a697d7d                                                                                                                                          0.0s
 => => naming to docker.io/library/docs                                                                                                                                                                                               0.0s
```

After this change, archives and reference-docs are using the build-cache,
and building was reduced to ~126 seconds (most of that taken by Jekyll to
generate the static HTML);

```
docker build -t docs .

+] Building 126.4s (30/30) FINISHED
...
 => CACHED [upstream-resources 1/4] COPY ./_scripts/fetch-upstream-resources.sh ./_scripts/                                                                                                                                           0.0s
 => CACHED [upstream-resources 2/4] COPY ./_config.yml .                                                                                                                                                                              0.0s
 => CACHED [upstream-resources 3/4] COPY ./_data/toc.yaml ./_data/                                                                                                                                                                    0.0s
 => CACHED [upstream-resources 4/4] RUN bash ./_scripts/fetch-upstream-resources.sh .                                                                                                                                                 0.0s
 => [current 2/4] COPY --from=upstream-resources /usr/src/app/md_source/. ./                                                                                                                                                          1.5s
 => [current 3/4] RUN jekyll build -d /usr/share/nginx/html                                                                                                                                                                         108.9s
 => [current 4/4] RUN find /usr/share/nginx/html -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done                                                      4.8s
 => CACHED [deploybase 2/2] COPY --from=docs/docker.github.io:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf                                                                                             0.0s
 => CACHED [archives 1/5] COPY --from=docs/docker.github.io:v17.03 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                        0.0s
 => CACHED [archives 2/5] COPY --from=docs/docker.github.io:v17.06 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                        0.0s
 => CACHED [archives 3/5] COPY --from=docs/docker.github.io:v17.09 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                        0.0s
 => CACHED [archives 4/5] COPY --from=docs/docker.github.io:v17.12 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                        0.0s
 => CACHED [archives 5/5] COPY --from=docs/docker.github.io:v18.03 /usr/share/nginx/html /usr/share/nginx/html                                                                                                                        0.0s
 => [deploy 1/1] COPY --from=current /usr/share/nginx/html /usr/share/nginx/html                                                                                                                                                      4.1s
 => exporting to image                                                                                                                                                                                                                1.9s
 => => exporting layers                                                                                                                                                                                                               1.9s
 => => writing image sha256:e76359b937fb4d956fb17e889a7333687929d4c9ae093909fe5630a8f3e4de64                                                                                                                                          0.0s
 => => naming to docker.io/library/docs                                                                                                                                                                                               0.0s
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-06 16:38:38 +01:00
Sebastiaan van Stijn f98576eaa2
Dockerfile: use ARG to configure engine and distribution branches
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-06 15:15:14 +01:00
Sebastiaan van Stijn 5d8ce076f7
Dockerfile: remove use of $SOURCE env-var
This variable is no longer needed, as the scripts are
always executed relative to the current directory (`.`).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-06 15:10:07 +01:00
Sebastiaan van Stijn d386c4cd2c
Dockerfile: use WORKDIR to simplify steps
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-06 15:02:29 +01:00
paigehargrave 1bd777e22d
Update Dockerfile 2019-01-09 10:51:06 -05:00
Maria Bermudez 5515c2ba33 Update 18.03 tag 2018-11-07 14:15:52 -08:00
Maria Bermudez 169da400a1 Add new archive that's pointed to docs/docs-private for now - will need to be changed when we go live 2018-11-06 12:58:05 -08:00
Joao Fernandes bb1b53897c Update archives.yml for 18.03 2018-03-22 16:52:53 -07:00
Misty Stanley-Jones de9262b939
Add 17.09 archive to Dockerfile (#5660) 2018-01-03 11:47:32 -08:00
Misty Stanley-Jones 44d4cb7665
Improve ordering of master Dockerfile (#5630) 2017-12-27 10:13:44 -08:00
Misty Stanley-Jones 6051302b4d
Use multistage build for master (#5369) 2017-12-26 23:17:44 -08:00
Misty Stanley-Jones a30b95e49d Add API 1.33, API matrix 2017-10-17 21:34:07 -07:00
Misty Stanley-Jones 6aae2e4e84 Add pointer to latest API ref (#4897) 2017-10-16 15:04:24 -07:00
Misty Stanley-Jones 103a3f8003 17.03 archive setup (#3753) 2017-06-29 16:55:18 -07:00
John Mulhausen 089f17eade
Add to shell call, Alpine necessity 2017-05-25 15:08:51 -07:00
John Mulhausen f95cccd24a
Update docs base description 2017-05-25 15:00:02 -07:00
Misty Stanley-Jones 9c648cf079 Docker 17.05 docs (#3092)
* Add Netlify build script

* Pull 'edge' stuff from master for now

* Add env-regex logging opt (#2688)

* Update Dockerfile to pull from 17.05 branch

* Update YAML files from 17.05.x branch

* Add scaffolding for 17.05 content

* Document highlights for 17.05

* Add v1.29 API

* Document multi-stage builds
2017-05-05 19:50:22 +00:00
Misty Stanley-Jones 10be60a80f Go back to small /edge (#2736)
* Go back to small /edge

* Update site front page

Add info about Editions
Reorganize components
Update headings

* Move logic of fetching content to a script

* Add v1.28 API

* Add info about versioned API
2017-04-13 18:58:56 -07:00
Misty Stanley-Jones 62d34e400b Update Dockerfile to build /edge 2017-04-05 17:45:44 -07:00
Misty Stanley-Jones e796ce8148 Site-specific changes for Edge 2017-04-05 17:45:44 -07:00
Misty Stanley-Jones dfc7f870c1 Use a different variable for svn than wget
The master branch is called trunk in svn parlance
and the directory structure is a little bit different.

Also trust the certificates for the https svn connections,
otherwise we may be prompted.

Fix Dockerfile in vnext-engine
2017-04-05 17:45:44 -07:00
Misty Stanley-Jones 184897095f Use a different variable for svn than wget
The master branch is called trunk in svn parlance
and the directory structure is a little bit different.

Also trust the certificates for the https svn connections,
otherwise we may be prompted.
2017-04-05 17:45:44 -07:00
Misty Stanley-Jones cb0c69c9d5 Fix Dockerfile in vnext-engine 2017-04-05 17:45:44 -07:00
Misty Stanley-Jones cff043f5a3 Use a different variable for svn than wget
The master branch is called trunk in svn parlance
and the directory structure is a little bit different.

Also trust the certificates for the https svn connections,
otherwise we may be prompted.
2017-04-05 17:45:44 -07:00
Misty Stanley-Jones 13004b9ed1 Take docker/docker references from master 2017-04-05 17:45:44 -07:00
Misty Stanley-Jones e6aa7e3f50 Update distribution version in Dockerfile (#2632) 2017-04-05 11:20:49 -07:00
Victor Vieux ad065409d9 bump api to 1.27 (#2461)
* bump api to 1.27

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-03-28 09:31:53 -07:00
Misty Stanley-Jones fc343a81fc Update to new Docker version scheme (#1926) 2017-03-01 14:52:34 -08:00
John Mulhausen a3dd8ff96e Switch to auto-building source of docs-base 2017-02-11 02:55:53 -08:00