Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add comments to dockerd daemon.json?

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?

like image 790
KamilCuk Avatar asked Jun 25 '26 00:06

KamilCuk


1 Answers

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.

like image 189
Antonio Petricca Avatar answered Jun 27 '26 13:06

Antonio Petricca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!