Commit Graph

371 Commits

Author SHA1 Message Date
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