Skip to content

cli/context/store: don't treat .DS_Store files as TLS material - #7333

Open
2arian3 wants to merge 1 commit into
docker:masterfrom
2arian3:context-ignore-os-metadata-files
Open

2arian3 wants to merge 1 commit into
docker:masterfrom
2arian3:context-ignore-os-metadata-files

Conversation

@2arian3

@2arian3 2arian3 commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

On macOS, opening a context's TLS directory in Finder can leave a .DS_Store file in it. After that, every command that talks to the daemon through the context prints a warning:

unknown file in context my-context TLS bundle: .DS_Store

The file also shows up in docker context inspect, and gets included by docker context export.

None of the TLS files the CLI writes (ca.pem, cert.pem, key.pem) are hidden, so this skips hidden files when listing a context's TLS files. That covers .DS_Store, ._* AppleDouble files, and the .tmp-* files that atomicwriter leaves behind if a write is interrupted. Windows Explorer's Thumbs.db and desktop.ini are skipped too, ignoring case. Any other unexpected file, like a certificate saved as ca.crt, still gets the warning.

To try it, with a context that has TLS files:

$ touch "$(docker context inspect my-context --format '{{.Storage.TLSPath}}')/docker/.DS_Store"
$ docker --context my-context ps

Without this change the warning is printed. With it, it isn't.

Release notes (optional)

Don't print a warning for `.DS_Store` and similar files in a context's TLS directory.

Opening a context's TLS directory in Finder can create a ".DS_Store"
file there. After that, every command that talks to the daemon through
the context prints a warning:

    unknown file in context my-context TLS bundle: .DS_Store

The file also shows up in "docker context inspect", and is included by
"docker context export".

None of the TLS files the CLI writes ("ca.pem", "cert.pem", "key.pem")
are hidden, so skip hidden files when listing a context's TLS files.
Besides ".DS_Store", this covers the "._*" AppleDouble files macOS
creates on drives that can't store extended attributes (such as
FAT-formatted USB drives), and temporary files left behind if writing
a TLS file is interrupted. Windows Explorer's "Thumbs.db" and
"desktop.ini" are skipped too, ignoring case.

Other unexpected files, such as a certificate saved as "ca.crt", still
produce a warning.

Signed-off-by: Arian Boukani <arbo@yorku.ca>
@2arian3
2arian3 force-pushed the context-ignore-os-metadata-files branch from 26b719f to 860a61d Compare September 25, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI should ignore .DS_Store files in context bundles

1 participant