Skip to content

Commit 031233d

Browse files
committed
docs: emphasize the fact that secrets aren't saved in cache
I was reading through the documentation trying to understand what's so special about secret type mount except for extra options it takes as I found that contents of bind mount doesn't get baked into the image too but it can be found in /var/lib/docker in contrary to secret type mount. I've learned that secret type mount uses tmpfs under the hood and my findings were confirmed by https://docs.docker.com/build/cache/invalidation/#general-rules: 'The contents of build secrets are not part of the build cache.'. I think it's worth emphasizing in the documentation. Fixes docker/docs#20436. Signed-off-by: Arkadiusz Drabczyk <[email protected]>
1 parent bc92b63 commit 031233d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

frontend/dockerfile/docs/reference.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,13 +669,13 @@ This can be used to:
669669

670670
The supported mount types are:
671671

672-
| Type | Description |
673-
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------- |
674-
| [`bind`](#run---mounttypebind) (default) | Bind-mount context directories (read-only). |
675-
| [`cache`](#run---mounttypecache) | Mount a temporary directory to cache directories for compilers and package managers. |
676-
| [`tmpfs`](#run---mounttypetmpfs) | Mount a `tmpfs` in the build container. |
677-
| [`secret`](#run---mounttypesecret) | Allow the build container to access secure files such as private keys without baking them into the image. |
678-
| [`ssh`](#run---mounttypessh) | Allow the build container to access SSH keys via SSH agents, with support for passphrases. |
672+
| Type | Description |
673+
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------- |
674+
| [`bind`](#run---mounttypebind) (default) | Bind-mount context directories (read-only). |
675+
| [`cache`](#run---mounttypecache) | Mount a temporary directory to cache directories for compilers and package managers. |
676+
| [`tmpfs`](#run---mounttypetmpfs) | Mount a `tmpfs` in the build container. |
677+
| [`secret`](#run---mounttypesecret) | Allow the build container to access secure files such as private keys without baking them into the image and build cache. |
678+
| [`ssh`](#run---mounttypessh) | Allow the build container to access SSH keys via SSH agents, with support for passphrases. |
679679

680680
### RUN --mount=type=bind
681681

0 commit comments

Comments
 (0)