CONFIG.JSON(5)

πŸ“¦
version 29.9.2 Β· 5 versions
, in fedora 43, fedora 44, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 for docker ps output. when you don't pass the --format flag with docker 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-keys flag with docker attach, docker exec, docker run or docker start, Docker's client uses this property. if it isn't set, the client falls back to the default sequence ctrl-p,ctrl-q πŸ”₯
  • imagesFormat πŸ“ β€” the default format for docker images output. when --format isn't provided with the docker images command, 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 πŸ‘‘πŸ¦‹