From 7fed5214ccfebec7da9e739dc6a4e5becde664bf Mon Sep 17 00:00:00 2001 From: Ralph Bisschops Date: Thu, 27 May 2021 10:07:04 +0000 Subject: [PATCH 01/74] Add comments to `wait-for-postgres.sh` Add additional comment to explain code --- compose/startup-order.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compose/startup-order.md b/compose/startup-order.md index a9b1a5e0812f..e432ee181086 100644 --- a/compose/startup-order.md +++ b/compose/startup-order.md @@ -68,14 +68,25 @@ script: set -e host="$1" + # Shift arguments with mapping: + # - $0 => $0 + # - $1 => + # - $2 => $1 + # - $3 => $2 + # - ... + # This is done for `exec "$@"` below to work correctly shift + # Login for user (`-U`) and once logged in execute quit ( `-c \q` ) + # If we can not login sleep for 1 sec until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "postgres" -c '\q'; do >&2 echo "Postgres is unavailable - sleeping" sleep 1 done >&2 echo "Postgres is up - executing command" + # Print and execute all other arguments starting with `$1` + # So `exec "$1" "$2" "$3" ...` exec "$@" ``` From 41114e2f930fd3a78cfe7e74eeb21d787ff48bb1 Mon Sep 17 00:00:00 2001 From: craig-osterhout Date: Thu, 29 Sep 2022 16:13:54 -0700 Subject: [PATCH 02/74] Remove redirects for samples --- _samples/library/adminer.md | 2 -- _samples/library/elasticsearch.md | 2 -- _samples/library/mariadb.md | 2 -- _samples/library/mysql.md | 2 -- _samples/library/nextcloud.md | 2 -- _samples/library/nginx.md | 2 -- _samples/library/php.md | 2 -- _samples/library/postgres.md | 2 -- _samples/library/python.md | 2 -- _samples/library/redis.md | 2 -- _samples/library/rust.md | 2 -- _samples/library/traefik.md | 2 -- 12 files changed, 24 deletions(-) diff --git a/_samples/library/adminer.md b/_samples/library/adminer.md index 166de852cf9a..da58ce4de1e0 100644 --- a/_samples/library/adminer.md +++ b/_samples/library/adminer.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/adminer/ -redirect_from: -- /samples/adminer/ --- diff --git a/_samples/library/elasticsearch.md b/_samples/library/elasticsearch.md index 602db86a0a26..b825dbe188f8 100644 --- a/_samples/library/elasticsearch.md +++ b/_samples/library/elasticsearch.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/elasticsearch/ -redirect_from: -- /samples/elasticsearch/ --- diff --git a/_samples/library/mariadb.md b/_samples/library/mariadb.md index 02204ef1688f..0e7966fd8062 100644 --- a/_samples/library/mariadb.md +++ b/_samples/library/mariadb.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/mariadb/ -redirect_from: -- /samples/mariadb/ --- diff --git a/_samples/library/mysql.md b/_samples/library/mysql.md index f867d6c3ffd6..3d0cc4929f18 100644 --- a/_samples/library/mysql.md +++ b/_samples/library/mysql.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/mysql/ -redirect_from: -- /samples/mysql/ --- diff --git a/_samples/library/nextcloud.md b/_samples/library/nextcloud.md index b3b2cfb9e82e..c16e32a275b8 100644 --- a/_samples/library/nextcloud.md +++ b/_samples/library/nextcloud.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/nextcloud/ -redirect_from: -- /samples/nextcloud/ --- diff --git a/_samples/library/nginx.md b/_samples/library/nginx.md index 6788a81d67e7..797e3fcabc20 100644 --- a/_samples/library/nginx.md +++ b/_samples/library/nginx.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/nginx/ -redirect_from: -- /samples/nginx/ --- diff --git a/_samples/library/php.md b/_samples/library/php.md index cecab497d458..136550ae110e 100644 --- a/_samples/library/php.md +++ b/_samples/library/php.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/php/ -redirect_from: -- /samples/php/ --- diff --git a/_samples/library/postgres.md b/_samples/library/postgres.md index ca4e0f987c95..aff9eed95e20 100644 --- a/_samples/library/postgres.md +++ b/_samples/library/postgres.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/postgres/ -redirect_from: -- /samples/postgres/ --- diff --git a/_samples/library/python.md b/_samples/library/python.md index 19ac114ef348..b2c7377cb741 100644 --- a/_samples/library/python.md +++ b/_samples/library/python.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/python/ -redirect_from: -- /samples/python/ --- diff --git a/_samples/library/redis.md b/_samples/library/redis.md index ca1c13872895..0cb784a54ae4 100644 --- a/_samples/library/redis.md +++ b/_samples/library/redis.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/redis/ -redirect_from: -- /samples/redis/ --- diff --git a/_samples/library/rust.md b/_samples/library/rust.md index 879e5b7933e9..aa6cee3267be 100644 --- a/_samples/library/rust.md +++ b/_samples/library/rust.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/rust/ -redirect_from: -- /samples/rust/ --- diff --git a/_samples/library/traefik.md b/_samples/library/traefik.md index ec43ca40635b..a13a2fda3e47 100644 --- a/_samples/library/traefik.md +++ b/_samples/library/traefik.md @@ -1,5 +1,3 @@ --- redirect_to: https://hub.docker.com/_/traefik/ -redirect_from: -- /samples/traefik/ --- From bf279fdc04b95b88575759227dbe48d07f9d03e0 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 6 Oct 2022 14:02:16 +0200 Subject: [PATCH 03/74] css: fix button padding Signed-off-by: CrazyMax --- _scss/_buttons.scss | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/_scss/_buttons.scss b/_scss/_buttons.scss index 760d73179331..3a6799276abf 100755 --- a/_scss/_buttons.scss +++ b/_scss/_buttons.scss @@ -11,7 +11,6 @@ a.button { a.button.outline-btn { color: $primary-links; float: none; - margin-bottom: 30px; display: inline-block; } @@ -23,7 +22,7 @@ a.button.outline-btn.min-hgt { display: inline-block; margin: 10px 10px 10px 0; font-family: $buttons; - padding: 12px 35px 10px; + padding: 12px 35px; min-width: 200px; box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1); text-align: center; @@ -35,10 +34,9 @@ a.button.outline-btn.min-hgt { } .primary-btn { - background: $primary-links; - border: 1px solid rgba(0, 0, 0, 0.1); + background: $primary-links; + border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 4px; - padding-top: 16px } /* From e66696fd63d92d6dcd38306d8be9ab6565313848 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 6 Oct 2022 14:16:50 +0200 Subject: [PATCH 04/74] build: improve overview page Signed-off-by: CrazyMax --- _data/toc.yaml | 4 ++-- build/customize/bake/index.md | 2 +- build/index.md | 45 ++++++++++++++++++++++++----------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/_data/toc.yaml b/_data/toc.yaml index 9a5c297e88ec..32817207f04f 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -1473,7 +1473,7 @@ manuals: - path: /build/building/packaging/ title: Packaging your software - path: /build/building/cache/ - title: Optimizing builds with cache management + title: Optimizing builds with cache - sectiontitle: Choosing a build driver section: - path: /build/building/drivers/ @@ -1492,7 +1492,7 @@ manuals: title: Multi-platform images - sectiontitle: Customizing builds section: - - sectiontitle: Orchestrating builds with Bake + - sectiontitle: High-level builds with Bake section: - path: /build/customize/bake/ title: Overview diff --git a/build/customize/bake/index.md b/build/customize/bake/index.md index 63f7a41c8059..d5dbc030de6c 100644 --- a/build/customize/bake/index.md +++ b/build/customize/bake/index.md @@ -1,5 +1,5 @@ --- -title: "High-level build options with Bake" +title: High-level builds with Bake keywords: build, buildx, bake, buildkit, hcl, json, compose redirect_from: - /build/bake/ diff --git a/build/index.md b/build/index.md index 58635c18cc0e..b318af2fb782 100644 --- a/build/index.md +++ b/build/index.md @@ -48,27 +48,41 @@ advanced scenarios: ### Packaging your software -Bundle and package your code to run anywhere, from your local Docker Desktop, -to Docker Engine and Kubernetes on the cloud. To get started with Build, -see the [Packaging your software](building/packaging.md) page. +Build and package your application to run it anywhere: locally using Docker +Desktop, or in the cloud using Docker Engine and Kubernetes: + +[Packaging your software](building/packaging.md){: .button .outline-btn } ### Choosing a build driver Run Buildx with different configurations depending on the scenario you are working on, regardless of whether you are using your local machine or a remote -compute cluster, all from the comfort of your local working environment. -For more information on drivers, see the [drivers guide](building/drivers/index.md). +cluster, all from the comfort of your local working environment: + +[Choosing a build driver](building/drivers/index.md){: .button .outline-btn } -### Optimizing builds with cache management +### Optimizing builds with cache Improve build performance by using a persistent shared build cache to avoid -repeating costly operations such as package installations, downloading files -from the internet, or code build steps. +repeating costly operations such as package installs, file downloads, or code +build steps: + +[Optimizing builds with cache](building/cache.md){: .button .outline-btn } + +### Multi-stage builds -### Creating build-once, run-anywhere with multi-platform builds +Use the multi-stage feature to selectively copy artifacts from one stage to +another, leaving behind everything you don't want in the final image, so you +keep your images small and secure with minimal depeendencies: -Collaborate across platforms with one build artifact. See -[Multi-platform images](building/multi-platform.md) page. +[Multi-stage builds](building/multi-stage.md){: .button .outline-btn } + +### Multi-platform images + +Using the standard Docker tooling and processes, you can start to build, push, +pull, and run images seamlessly on different computer architectures: + +[Multi-platform images](building/multi-platform.md){: .button .outline-btn } ## Continuous integration @@ -92,10 +106,13 @@ like from BuildKit, not just docker images. See [Set the export action for the b Securely access protected repositories and resources at build time without leaking data into the final build or the cache. -### Orchestrating builds using Bake +### High-level builds with Bake + +Bake provides support for high-level build concepts using a file definition +that goes beyond invoking a single build command. Bake allows all the services +to be built concurrently as part of a single request: -Connect your builds together and easily parameterize your images using buildx bake. -See [High-level build options with Bake](customize/bake/index.md). +[High-level builds with Bake](customize/bake/index.md){: .button .outline-btn } ## Extending BuildKit From 6494346dbe9f86161e3a5cb85c5643fb46552735 Mon Sep 17 00:00:00 2001 From: Mohamed Ramadan <54960175+sudofix@users.noreply.github.com> Date: Sat, 8 Oct 2022 23:11:48 +0200 Subject: [PATCH 05/74] Fix a typo in release 2.11.2 date "2002->2022" --- compose/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/release-notes.md b/compose/release-notes.md index 599766b81d92..b322d6d46b05 100644 --- a/compose/release-notes.md +++ b/compose/release-notes.md @@ -8,7 +8,7 @@ redirect_from: --- ## 2.11.2 -(2002-09-27) +(2022-09-27) > **Note** > From c18d54fcc78039c0d3cb10e99421b8ef849fca89 Mon Sep 17 00:00:00 2001 From: Rohan Mathur Date: Mon, 10 Oct 2022 17:16:07 +0530 Subject: [PATCH 06/74] docs: fix typo --- desktop/use-desktop/images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/use-desktop/images.md b/desktop/use-desktop/images.md index 84424323809e..c4076c7c357e 100644 --- a/desktop/use-desktop/images.md +++ b/desktop/use-desktop/images.md @@ -47,7 +47,7 @@ Inspecting an image displays detailed information about the image such as the: - Image history - Image ID - Date the image was created -- Size of the imag +- Size of the image To inspect an image, hover over an image, select the **More options** button and then select **Inspect** from the dropdown menu. From bda82b638492e85fce1c846c1c3f50b936cee591 Mon Sep 17 00:00:00 2001 From: Mohan_J <57227290+PMohanJ@users.noreply.github.com> Date: Mon, 10 Oct 2022 21:06:38 +0530 Subject: [PATCH 07/74] Fix typo in bind-mounts.md --- storage/bind-mounts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/bind-mounts.md b/storage/bind-mounts.md index 3170864a9de8..f51b664375eb 100644 --- a/storage/bind-mounts.md +++ b/storage/bind-mounts.md @@ -396,7 +396,7 @@ services: volumes: - type: bind source: ./static - target: /opt/app/staticvolumes: + target: /opt/app/staticvolumes myapp: ``` From 0d14bcb8c3c05b80eef1a1ff9b0dc7b8b27dc90d Mon Sep 17 00:00:00 2001 From: Akira Aso <44665462+akiraaso@users.noreply.github.com> Date: Wed, 12 Oct 2022 01:59:32 +0900 Subject: [PATCH 08/74] Make a paragraph about docker ps concise (#15839) --- language/nodejs/run-containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/nodejs/run-containers.md b/language/nodejs/run-containers.md index 5d94c04a479a..a9e39d8fdd2a 100644 --- a/language/nodejs/run-containers.md +++ b/language/nodejs/run-containers.md @@ -87,7 +87,7 @@ $ curl --request POST \ ## List containers -Since we ran our container in the background, how do we know if our container is running or what other containers are running on our machine? Well, we can run the `docker ps` command. Just like on Linux, to see a list of processes on your machine we would run the ps command. In the same spirit, we can run the `docker ps` command which will show us a list of containers running on our machine. +Since we ran our container in the background, how do we know if our container is running or what other containers are running on our machine? Well, to see a list of containers running on our machine, run `docker ps`. This is similar to how ps command is used to see a list of processes on a Linux machine. ```console $ docker ps From 2706acd2ec61c3533849fc3d497661baa851e6de Mon Sep 17 00:00:00 2001 From: Daniel Schroeder Date: Tue, 11 Oct 2022 16:14:12 -0500 Subject: [PATCH 09/74] Update develop.md (#15829) There is no logic in that Flask app to save widgets, so I reworded the two sentences that referenced saving widgets. There are two routes: 1. `/widgets` -> Gets all the rows from the `widgets` table 2. `/initdb` -> Drops the DB/Table and rebuilds them from scratch --- language/python/develop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/language/python/develop.md b/language/python/develop.md index fa4f6fb62615..5f0c62a835d6 100644 --- a/language/python/develop.md +++ b/language/python/develop.md @@ -73,7 +73,7 @@ In the above command, we logged in to the MySQL database by passing the ‘mysql Next, we'll update the sample application we created in the [Build images](build-images.md#sample-application) module. To see the directory structure of the Python app, see [Python application directory structure](build-images.md#directory-structure). -Okay, now that we have a running MySQL, let’s update the `app.py` to use MySQL as a datastore. Let’s also add some routes to our server. One for fetching records and one for inserting records. +Okay, now that we have a running MySQL, let’s update the `app.py` to use MySQL as a datastore. Let’s also add some routes to our server. One for fetching records and one for creating our database and table. ```python import mysql.connector @@ -141,7 +141,7 @@ if __name__ == "__main__": app.run(host ='0.0.0.0') ``` -We’ve added the MySQL module and updated the code to connect to the database server, created a database and table. We also created a couple of routes to save widgets and fetch widgets. We now need to rebuild our image so it contains our changes. +We’ve added the MySQL module and updated the code to connect to the database server, created a database and table. We also created a route to fetch widgets. We now need to rebuild our image so it contains our changes. First, let’s add the `mysql-connector-python` module to our application using pip. From b05c38a6f6f6c7d059c4c50e468973e017b1393b Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:40:06 +0200 Subject: [PATCH 10/74] add cache backend docs (upstream) (#15853) Signed-off-by: David Karlsson Signed-off-by: David Karlsson --- _config.yml | 3 +++ _data/toc.yaml | 22 +++++++++++++++++--- build/building/cache/backends/azblob.md | 7 +++++++ build/building/cache/backends/gha.md | 7 +++++++ build/building/cache/backends/index.md | 7 +++++++ build/building/cache/backends/inline.md | 7 +++++++ build/building/cache/backends/local.md | 7 +++++++ build/building/cache/backends/registry.md | 7 +++++++ build/building/cache/backends/s3.md | 7 +++++++ build/building/{cache.md => cache/index.md} | 14 ++++++------- build/images/cache-stack-invalidate-copy.dot | 2 +- build/images/cache-stack-invalidate-copy.svg | 4 ++-- build/images/cache-stack-invalidate-rest.dot | 2 +- build/images/cache-stack-invalidate-rest.svg | 4 ++-- build/images/cache-stack.dot | 2 +- build/images/cache-stack.svg | 4 ++-- build/index.md | 2 +- 17 files changed, 87 insertions(+), 21 deletions(-) create mode 100644 build/building/cache/backends/azblob.md create mode 100644 build/building/cache/backends/gha.md create mode 100644 build/building/cache/backends/index.md create mode 100644 build/building/cache/backends/inline.md create mode 100644 build/building/cache/backends/local.md create mode 100644 build/building/cache/backends/registry.md create mode 100644 build/building/cache/backends/s3.md rename build/building/{cache.md => cache/index.md} (96%) diff --git a/_config.yml b/_config.yml index 582084c34e1d..9c178aca2af9 100644 --- a/_config.yml +++ b/_config.yml @@ -172,6 +172,9 @@ fetch-remote: - dest: "build/building/drivers" src: - "docs/guides/drivers/**" + - dest: "build/building/cache/backends" + src: + - "docs/guides/cache/**" - repo: "https://github.com/distribution/distribution" default_branch: "main" diff --git a/_data/toc.yaml b/_data/toc.yaml index 32817207f04f..12609e91b4b2 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -1472,9 +1472,7 @@ manuals: section: - path: /build/building/packaging/ title: Packaging your software - - path: /build/building/cache/ - title: Optimizing builds with cache - - sectiontitle: Choosing a build driver + - sectiontitle: Build drivers section: - path: /build/building/drivers/ title: Overview @@ -1486,6 +1484,24 @@ manuals: title: Kubernetes driver - path: /build/building/drivers/remote/ title: Remote driver + - path: /build/building/cache/ + title: Optimizing builds with cache + - sectiontitle: Cache backends + section: + - path: /build/building/cache/backends/ + title: Overview + - path: /build/building/cache/backends/inline/ + title: Inline + - path: /build/building/cache/backends/local/ + title: Local + - path: /build/building/cache/backends/registry/ + title: Registry + - path: /build/building/cache/backends/gha/ + title: GitHub Actions + - path: /build/building/cache/backends/azblob/ + title: Azure Blob Storage + - path: /build/building/cache/backends/s3/ + title: Amazon S3 - path: /build/building/multi-stage/ title: Multi-stage builds - path: /build/building/multi-platform/ diff --git a/build/building/cache/backends/azblob.md b/build/building/cache/backends/azblob.md new file mode 100644 index 000000000000..2db5435fe5ea --- /dev/null +++ b/build/building/cache/backends/azblob.md @@ -0,0 +1,7 @@ +--- +title: "Azure Blob Storage cache" +keywords: build, buildx, cache, backend, azblob, azure +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache/backends/gha.md b/build/building/cache/backends/gha.md new file mode 100644 index 000000000000..c4bbc05ca83a --- /dev/null +++ b/build/building/cache/backends/gha.md @@ -0,0 +1,7 @@ +--- +title: "GitHub Actions cache" +keywords: build, buildx, cache, backend, gha, github, actions +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache/backends/index.md b/build/building/cache/backends/index.md new file mode 100644 index 000000000000..25f8047fc887 --- /dev/null +++ b/build/building/cache/backends/index.md @@ -0,0 +1,7 @@ +--- +title: "Cache storage backends" +keywords: build, buildx, cache, backend, gha, azblob, s3, registry, local +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache/backends/inline.md b/build/building/cache/backends/inline.md new file mode 100644 index 000000000000..960dead6060a --- /dev/null +++ b/build/building/cache/backends/inline.md @@ -0,0 +1,7 @@ +--- +title: "Inline cache" +keywords: build, buildx, cache, backend, inline +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache/backends/local.md b/build/building/cache/backends/local.md new file mode 100644 index 000000000000..ac7b305cee89 --- /dev/null +++ b/build/building/cache/backends/local.md @@ -0,0 +1,7 @@ +--- +title: "Local cache" +keywords: build, buildx, cache, backend, local +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache/backends/registry.md b/build/building/cache/backends/registry.md new file mode 100644 index 000000000000..7e738716b2be --- /dev/null +++ b/build/building/cache/backends/registry.md @@ -0,0 +1,7 @@ +--- +title: "Registry cache" +keywords: build, buildx, cache, backend, registry +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache/backends/s3.md b/build/building/cache/backends/s3.md new file mode 100644 index 000000000000..2482973aa991 --- /dev/null +++ b/build/building/cache/backends/s3.md @@ -0,0 +1,7 @@ +--- +title: "Amazon S3 cache" +keywords: build, buildx, cache, backend, s3 +fetch_remote: + line_start: 2 + line_end: -1 +--- diff --git a/build/building/cache.md b/build/building/cache/index.md similarity index 96% rename from build/building/cache.md rename to build/building/cache/index.md index 282e375c6cc6..6ce025c0e018 100644 --- a/build/building/cache.md +++ b/build/building/cache/index.md @@ -25,7 +25,7 @@ program written in C. FROM ubuntu:latest RUN apt-get update && apt-get install -y build-essentials -COPY main.c /src/ +COPY main.c Makefile /src/ WORKDIR /src/ RUN make build ``` @@ -34,7 +34,7 @@ Each instruction in this Dockerfile translates (roughly) to a layer in your final image. You can think of image layers as a stack, with each layer adding more content on top of the layers that came before it: -![Image layer diagram showing the above commands chained together one after the other](../images/cache-stack.svg){:.invertible} +![Image layer diagram showing the above commands chained together one after the other](../../images/cache-stack.svg){:.invertible} Whenever a layer changes, that layer will need to be re-built. For example, suppose you make a change to your program in the `main.c` file. After this @@ -42,13 +42,13 @@ change, the `COPY` command will have to run again in order for those changes to appear in the image. In other words, Docker will invalidate the cache for this layer. -![Image layer diagram, but now with the link between COPY and WORKDIR marked as invalid](../images/cache-stack-invalidate-copy.svg){:.invertible} +![Image layer diagram, but now with the link between COPY and WORKDIR marked as invalid](../../images/cache-stack-invalidate-copy.svg){:.invertible} If a layer changes, all other layers that come after it are also affected. When the layer with the `COPY` command gets invalidated, all layers that follow will need to run again, too: -![Image layer diagram, but now with all links after COPY marked as invalid](../images/cache-stack-invalidate-rest.svg){:.invertible} +![Image layer diagram, but now with all links after COPY marked as invalid](../../images/cache-stack-invalidate-rest.svg){:.invertible} And that's the Docker build cache in a nutshell. Once a layer changes, then all downstream layers need to be rebuilt as well. Even if they wouldn't build @@ -287,8 +287,6 @@ of continuing.) ## Other resources -For more information on using cache to do efficient builds: +For more information on using cache to do efficient builds, see: - - -- [Export your build cache](https://github.com/moby/buildkit#export-cache) +- [Cache storage backends](./backends/index.md) diff --git a/build/images/cache-stack-invalidate-copy.dot b/build/images/cache-stack-invalidate-copy.dot index b552138127e3..f97486f367e1 100644 --- a/build/images/cache-stack-invalidate-copy.dot +++ b/build/images/cache-stack-invalidate-copy.dot @@ -8,7 +8,7 @@ digraph { from [ label = <FROM ubuntu:latest> ]; deps [ label = <RUN apt-get update && \\
apt-get install -y build-essentials> ]; - copy [ label = <COPY main.c /src/>, color = "red" ]; + copy [ label = <COPY main.c Makefile /src/>, color = "red" ]; workdir [ label = <WORKDIR /src/> ]; build [ label = <RUN make build> ]; diff --git a/build/images/cache-stack-invalidate-copy.svg b/build/images/cache-stack-invalidate-copy.svg index a0408995dba5..1a93f67c1590 100644 --- a/build/images/cache-stack-invalidate-copy.svg +++ b/build/images/cache-stack-invalidate-copy.svg @@ -33,8 +33,8 @@ copy -COPY -main.c /src/ +COPY +main.c Makefile /src/ diff --git a/build/images/cache-stack-invalidate-rest.dot b/build/images/cache-stack-invalidate-rest.dot index 91c0ccc12740..81824186e092 100644 --- a/build/images/cache-stack-invalidate-rest.dot +++ b/build/images/cache-stack-invalidate-rest.dot @@ -8,7 +8,7 @@ digraph { from [ label = <FROM ubuntu:latest> ]; deps [ label = <RUN apt-get update && \\
apt-get install -y build-essentials> ]; - copy [ label = <COPY main.c /src/>, color = "red" ]; + copy [ label = <COPY main.c Makefile /src/>, color = "red" ]; workdir [ label = <WORKDIR /src/>, color = "red" ]; build [ label = <RUN make build>, color = "red" ]; diff --git a/build/images/cache-stack-invalidate-rest.svg b/build/images/cache-stack-invalidate-rest.svg index 7d0830d51dbf..ee6c2e0672d3 100644 --- a/build/images/cache-stack-invalidate-rest.svg +++ b/build/images/cache-stack-invalidate-rest.svg @@ -33,8 +33,8 @@ copy -COPY -main.c /src/ +COPY +main.c Makefile /src/ diff --git a/build/images/cache-stack.dot b/build/images/cache-stack.dot index 7df536f72725..31e35443248c 100644 --- a/build/images/cache-stack.dot +++ b/build/images/cache-stack.dot @@ -8,7 +8,7 @@ digraph { from [ label = <FROM ubuntu:latest> ]; deps [ label = <RUN apt-get update && \\
apt-get install -y build-essentials> ]; - copy [ label = <COPY main.c /src/> ]; + copy [ label = <COPY main.c Makefile /src/> ]; workdir [ label = <WORKDIR /src/> ]; build [ label = <RUN make build> ]; diff --git a/build/images/cache-stack.svg b/build/images/cache-stack.svg index 73522805a7d4..9ac19295941e 100644 --- a/build/images/cache-stack.svg +++ b/build/images/cache-stack.svg @@ -33,8 +33,8 @@ copy -COPY -main.c /src/ +COPY +main.c Makefile /src/ diff --git a/build/index.md b/build/index.md index b318af2fb782..16a6db032746 100644 --- a/build/index.md +++ b/build/index.md @@ -67,7 +67,7 @@ Improve build performance by using a persistent shared build cache to avoid repeating costly operations such as package installs, file downloads, or code build steps: -[Optimizing builds with cache](building/cache.md){: .button .outline-btn } +[Optimizing builds with cache](./building/cache/index.md){: .button .outline-btn } ### Multi-stage builds From 888941b295ed88d151118e735e103c8aa9d71568 Mon Sep 17 00:00:00 2001 From: Allie Sadler <102604716+aevesdocker@users.noreply.github.com> Date: Wed, 12 Oct 2022 12:30:00 +0100 Subject: [PATCH 11/74] contribute tweaks (#15859) --- _data/toc.yaml | 2 +- contribute/components/call-outs.md | 22 +++++++++++----------- contribute/overview.md | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/_data/toc.yaml b/_data/toc.yaml index 12609e91b4b2..5b43a1594fab 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -1811,7 +1811,7 @@ contribute: - path: /contribute/components/badges/ title: Badges - path: /contribute/components/call-outs/ - title: Call outs + title: Callouts - path: /contribute/components/cards/ title: Cards - path: /contribute/components/code-blocks/ diff --git a/contribute/components/call-outs.md b/contribute/components/call-outs.md index 4210a2ad739b..e7f8bcd3cb74 100644 --- a/contribute/components/call-outs.md +++ b/contribute/components/call-outs.md @@ -1,10 +1,10 @@ --- description: components and formatting examples used in Docker's docs -title: Call outs +title: Callouts toc_max: 3 --- -We support these broad categories of call outs: +We support these broad categories of callouts: - Notes (no Liquid tag required) - Important, which use the `{: .important}` tag @@ -37,21 +37,21 @@ We support these broad categories of call outs: > `docker-compose down`. If you want to remove the volumes, you will need to add > the `--volumes` flag. > -> The Docker Dashboard does _not_ remove volumes when you delete the app stack. +> The Docker Dashboard does not remove volumes when you delete the app stack. {: .warning} ## HTML ```html > **Note** - > - > Note the way the `get_hit_count` function is written. This basic retry - > loop lets us attempt our request multiple times if the redis service is - > not available. This is useful at startup while the application comes - > online, but also makes our application more resilient if the Redis - > service needs to be restarted anytime during the app's lifetime. In a - > cluster, this also helps handling momentary connection drops between - > nodes. +> +> Note the way the `get_hit_count` function is written. This basic retry +> loop lets us attempt our request multiple times if the redis service is +> not available. This is useful at startup while the application comes +> online, but also makes our application more resilient if the Redis +> service needs to be restarted anytime during the app's lifetime. In a +> cluster, this also helps handling momentary connection drops between +> nodes. > **Important** > diff --git a/contribute/overview.md b/contribute/overview.md index a17adadff51c..3ec41f1af34f 100644 --- a/contribute/overview.md +++ b/contribute/overview.md @@ -25,8 +25,8 @@ as possible for you to work in this repository. The following sections guide you
Docker Desktop for Mac
-

Grammar guide

-

Explore Docker's grammar guide.

+

Grammar and style

+

Explore Docker's grammar and style guide.

@@ -34,7 +34,7 @@ as possible for you to work in this repository. The following sections guide you
Docker for Linux
-

Formatting guidelines

+

Formatting

Format your content to match the rest of our documentation.

From ada4c6888cacccf579078ee221d38e5d0d9c0d81 Mon Sep 17 00:00:00 2001 From: Arslan Noor <45531079+arslannoorpansota@users.noreply.github.com> Date: Thu, 13 Oct 2022 02:25:30 +0500 Subject: [PATCH 12/74] added hypen (#15273) --- samples/django.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/django.md b/samples/django.md index 5dc460cfabc6..d8f936f57719 100644 --- a/samples/django.md +++ b/samples/django.md @@ -267,7 +267,7 @@ In this section, you set up the database connection for Django. ``` * Or, for a more elegant shutdown, switch to a different shell, and run - [docker compose down](../engine/reference/commandline/compose_down.md) from the top level of your + [docker-compose down](../engine/reference/commandline/compose_down.md) from the top level of your Django sample project directory. ```console From f9175682813bdd81f754f9062d36d726596c0949 Mon Sep 17 00:00:00 2001 From: Usha Mandya Date: Thu, 13 Oct 2022 14:56:02 +0100 Subject: [PATCH 13/74] Removed dupe of contribution guidelines Signed-off-by: Usha Mandya --- _data/toc.yaml | 3 - _layouts/landing.html | 3 +- contribute/overview.md | 1 + opensource/images/bonus.png | Bin 43524 -> 0 bytes opensource/images/docker-friends.png | Bin 221276 -> 0 bytes opensource/images/docs-site-feedback.png | Bin 490207 -> 0 bytes opensource/images/gordon.jpeg | Bin 19941 -> 0 bytes opensource/images/irc_login.png | Bin 19323 -> 0 bytes opensource/images/triage-label.png | Bin 12121 -> 0 bytes opensource/images/tutorials.png | Bin 37719 -> 0 bytes opensource/index.md | 75 ------------- opensource/ways.md | 129 ----------------------- registry/help.md | 1 - 13 files changed, 2 insertions(+), 210 deletions(-) delete mode 100644 opensource/images/bonus.png delete mode 100644 opensource/images/docker-friends.png delete mode 100644 opensource/images/docs-site-feedback.png delete mode 100644 opensource/images/gordon.jpeg delete mode 100644 opensource/images/irc_login.png delete mode 100644 opensource/images/triage-label.png delete mode 100644 opensource/images/tutorials.png delete mode 100644 opensource/index.md delete mode 100644 opensource/ways.md diff --git a/_data/toc.yaml b/_data/toc.yaml index 5b43a1594fab..998c1301a1ee 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -18,7 +18,6 @@ horizontalnav: - title: Contribute path: /contribute/overview/ node: contribute - # TODO unify navbbar links: homepage currently has a custom "articles" link hide_home: true home: {} @@ -376,8 +375,6 @@ guides: title: Use the VFS storage driver - path: /get-started/resources/ title: "Educational resources" -- path: /opensource/ - title: "Contribute to documentation" reference: - path: /reference/ diff --git a/_layouts/landing.html b/_layouts/landing.html index c68e77641629..5a8c70d13527 100644 --- a/_layouts/landing.html +++ b/_layouts/landing.html @@ -21,8 +21,7 @@ {%- for entry in site.data.toc.horizontalnav -%} {%- if entry.hide_home -%}{% continue %}{%- endif -%} {{ entry.title }} - {%- endfor -%} -
  • Articles
  • + {%- endfor -%}
  • Contribute