CONFIG.JSON(5)
π NAME π
okay bestie, welcome to CONFIG.JSON(5) from the Docker User Manuals π this one's all about HOME/.docker/config.json, which is the Default Docker configuration file π¦
β¨ INTRODUCTION β¨
okay so by default, the Docker command line keeps its config files in a folder called .docker inside your $HOME directory π Docker manages most of the files in there itself, so please don't touch them π but you can edit config.json to control some of how the docker command behaves. it's giving main character energy π
rn you can change how docker acts using environment variables or command-line options. you can also use stuff inside config.json to tweak some of that same behavior β¨ just keep the order of precedence in mind when you do this, because it matters π command line options beat environment variables, and environment variables beat anything you set in a config.json file. no cap, that's the whole hierarchy π
the config.json file stores a JSON encoding of a few properties:
HttpHeadersπ β a set of headers that get sent along in every message from the Docker client to the daemon. Docker doesn't try to interpret or understand these headers, it just puts them into the messages π«Ά and it won't let them change any headers Docker sets for itself.psFormatπΈ β the default format fordocker psoutput. when you don't pass the--formatflag withdocker ps, Docker's client uses this one instead. if it isn't set, the client falls back to the default table format. for a list of supported formatting directives, see docker-ps(1).detachKeysπ¦ β the default key sequence that detaches you from a container. when you don't pass the--detach-keysflag withdocker attach,docker exec,docker runordocker start, Docker's client uses this property. if it isn't set, the client falls back to the default sequencectrl-p,ctrl-qπ₯imagesFormatπ β the default format fordocker imagesoutput. when--formatisn't provided with thedocker imagescommand, Docker's client uses this property. if it isn't set, the client falls back to the default table format. for a list of supported formatting directives, see docker-images(1).
you can point Docker at a different config location too π§ use the DOCKER_CONFIG environment variable or the --config command line option. if you set both, then --config wins over DOCKER_CONFIG β¨ like this:
docker --config ~/testconfigs/ ps
that tells Docker to grab its config files from the ~/testconfigs/ directory when it runs the ps command π
π Examples π
okay here's a sample config.json file, so you can see the vibe:
{
"HttpHeaders": {
"MyHeader": "MyValue"
},
"psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
"imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
"detachKeys": "ctrl-e,e"
}
π HISTORY π
January 2016, created by Moxiegirl mary@docker.com β¨mailto:mary@docker.comβ© π
bestie, that's the whole page π«Ά this was the Docker Community manual, dated JANUARY 2016, for CONFIG.JSON(5) π β¨ now go slay your config file ππ¦
π¦ where this page comes from
- fedora 43: docker-cli 28.4.0-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- fedora 43: docker-cli 29.6.2-1.fc43
- fedora 43: docker-cli 29.8.2-2.fc43
- fedora 43: docker-cli 29.9.2-2.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- fedora 44: docker-cli 29.3.0-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- fedora 44: docker-cli 29.8.2-2.fc44
- fedora 44: docker-cli 29.9.2-2.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- ubuntu jammy: docker.io 29.1.3-0ubuntu3~22.04.2 Β· Apache-2.0
- ubuntu noble: docker.io 29.1.3-0ubuntu3~24.04.2 Β· Apache-2.0
- ubuntu questing: docker-ce-cli 5:29.5.3-1~ubuntu.25.10~questing
- ubuntu questing: docker.io 28.2.2-0ubuntu1
- ubuntu questing: docker.io 29.1.3-0ubuntu3~25.10.1
- ubuntu resolute: docker.io 29.1.3-0ubuntu4 Β· Apache-2.0
- ubuntu resolute: docker.io 29.1.3-0ubuntu4.1 Β· Apache-2.0
- ubuntu stonking: docker.io 29.7.2-0ubuntu1 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms