2

I checked documentation https://docs.docker.com/config/daemon/ and researched the net, but found no answer. How to add comments to deamon.json in docker daemon?

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
KamilCuk
  • 120,984
  • 8
  • 59
  • 111

1 Answers1

1

Actually you could not because it is a JSON file, which does not accept any kind of comment syntax.

Neither adding a dummy extra JSON field, name for example comments, works, beacause it causes a daemon startup failure (I tried it before writing this answer).

Here you can find a complete description of this issue. The article tells about the Microsoft JSONC (JSON with Comments) format.

A simple and stupid workaround maybe a README file to describe the settings placed into /etc/docker.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74