What is the `canary.json` file?

What is the canary.json file? (Mine’s in .config/docker/)

Is this file safe for versioning in dotfiles? If not, should it be written to XDG_STATE_HOME instead? Or elsewhere?

I don’t know. Docker Desktop by default doesn’t use that folder and the json file seems to be something independent, however, since it is in a “docker” folder, my guess is that it was created by a Docker Desktop extension.

The directory is because I set DOCKER_CONFIG dir to make it somewhat xdg compliant (since it’s not or at least was not xdg compliant in the past).

So directory isn’t meaningful but the file would probably be ~/.docker/canary.json by default.

I don’t have it there either. Actually that was the first I looked for it, then I relized you mentioned a different folder.

So knowing what the folder is, my second guess is that the file is created when you run a specific command, but I still don’t know what it is. Can you share the content of the file or at least the structure of the json without the values if that contains something secret?

Moderator note: first json removed by rimelek.


(plaintext paste in case email formatting is weird:)

$ cat .config/docker/canary.json

{
  "compose-versions": {
    "2.6.0": {
      "active-percentage": 1,
      "include-pro-users": true,
      "default": 0.00
    }
  }
}

Thank you for the json. Both of the outputs were “weird” so I edited your post. Please, when you share source codes, use code blocks as described here: How to format your forum posts

I know this file is familiar from somewhere, but I don’t remember why.

Yep, I was replying via email and the backticks were interpreted by the mail client :frowning:

It must be related to the canary deployment strategy

Despite what I thought, Docker Desktop actually looks for it:

Quote:

[2023-04-11T08:29:52.985068725Z][com.docker.diagnose][I] Gathering /.docker/canary.json
[2023-04-11T08:29:52.985284230Z][com.docker.diagnose][W] /.docker/canary.json not included
[2023-04-11T08:29:52.985489094Z][com.docker.diagnose][I] Gathering /.docker/canary.json took 217.784µs