# Docker — full corpus
# LLM Wiki
An open-source template for building LLM-powered knowledge bases, following [Andrej Karpathy's "LLM Wiki" pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).
You provide raw sources. The LLM reads them, writes structured wiki pages, cross-links everything, and maintains it over time. You never edit the wiki directly — you curate sources and ask questions.
## How It Works
The system has three layers:
```
raw/ Sources you collect (articles, transcripts, notes, PDFs)
wiki/ LLM-written & maintained pages (summaries, concepts, entities, syntheses)
CLAUDE.md Schema that tells the LLM how to structure everything
```
Three operations drive the workflow:
| Operation | Trigger | What happens |
|-----------|---------|--------------|
| **Ingest** | "ingest raw/my-source.txt" | LLM reads the source, creates a summary page, creates/updates concept and entity pages, adds cross-links, updates the index and log |
| **Query** | Ask any question | LLM searches the wiki, synthesizes an answer with citations, optionally creates a synthesis page for novel insights |
| **Lint** | "lint" or "health check" | LLM audits all pages for orphans, contradictions, missing links, incomplete sections, and low-confidence claims — fixes what it can, reports the rest |
## Quick Start
1. **Clone this repo**
```bash
git clone https://github.com/YOUR_USERNAME/llm-wiki.git my-knowledge-base
cd my-knowledge-base
```
2. **Customize CLAUDE.md** for your domain
- Update the Purpose section with your topic
- Replace the placeholder tagging taxonomy with your own categories
- Adjust confidence level descriptions if needed
- Everything else (workflows, page formats, linking rules) works as-is
3. **Drop sources into `raw/`**
- Text files, transcripts, articles, notes — any plain text
- These are immutable once added; the LLM never modifies them
4. **Tell the LLM to ingest**
```
ingest raw/my-first-source.txt
```
The LLM will create summary pages, concept pages, entity pages, cross-links, and update the index.
5. **Ask questions**
```
What are the key differences between X and Y?
```
The LLM answers from the wiki, citing specific pages.
6. **Run health checks**
```
lint
```
The LLM audits the wiki and fixes issues.
## Directory Structure
```
.
├── CLAUDE.md # Schema — the LLM's instructions
├── raw/ # Your source documents (immutable)
└── wiki/
├── index.md # Master catalog of all pages
├── log.md # Append-only activity log
├── dashboard.md # Dataview dashboard (Obsidian)
├── analytics.md # Charts View analytics (Obsidian)
├── flashcards.md # Spaced repetition cards
├── summaries/ # One page per source document
├── concepts/ # Concept and framework pages
├── entities/ # People, tools, organizations, etc.
├── syntheses/ # Cross-cutting analyses and comparisons
├── journal/ # Research/session journal entries
│ └── template.md # Journal entry template
└── presentations/ # Marp slide decks
```
## Enhancements
This template includes several extras beyond the core wiki pattern:
### Dataview Dashboard (`wiki/dashboard.md`)
Live queries that surface low-confidence pages, recent updates, concepts by tag, and pages with the most sources. Requires the [Dataview](https://github.com/blacksmithgu/obsidian-dataview) Obsidian plugin.
### Charts View Analytics (`wiki/analytics.md`)
Visual analytics with pie charts, bar charts, and word clouds. Requires the [Charts View](https://github.com/caronchen/obsidian-chartsview-plugin) Obsidian plugin.
### Mermaid Diagrams
Use Mermaid code blocks in any wiki page to create flowcharts, sequence diagrams, or concept maps. Native support in Obsidian and GitHub.
### Marp Slides (`wiki/presentations/`)
Create slide decks from markdown using [Marp](https://marp.app/). Drop presentation files in this directory.
### Research Journal (`wiki/journal/`)
Track your research sessions, experiments, or applied work with the included template. The LLM can reference journal entries when answering queries.
### Spaced Repetition (`wiki/flashcards.md`)
Flashcards in the format used by the [Spaced Repetition](https://github.com/st3v3nmw/obsidian-spaced-repetition) Obsidian plugin. Ask the LLM to generate flashcards from any wiki page.
### MCP Server
This repo works with Claude Code's MCP server capabilities. Point an MCP-compatible client at this repo and the LLM can read/write the wiki programmatically.
## Customizing for Your Domain
The schema in `CLAUDE.md` is domain-agnostic. To adapt it:
1. **Purpose** — Describe your knowledge domain in one paragraph
2. **Tagging taxonomy** — Replace placeholder categories with your own (e.g., for a cooking KB: `cuisine`, `technique`, `ingredient`, `equipment`)
3. **Confidence levels** — Adjust the descriptions to match your domain's evidence standards
4. **Entity types** — Update the entity page description to match what entities mean in your domain (people, tools, companies, etc.)
5. **Journal template** — Customize `wiki/journal/template.md` for your workflow
Everything else — page format, linking conventions, workflows, rules — is universal and works across domains.
## Example Domains
This template works for any knowledge-intensive topic:
- **Research notes** — papers, experiments, methodologies
- **Book analysis** — themes, characters, author techniques
- **Competitive analysis** — companies, products, market trends
- **Course notes** — lectures, readings, key concepts
- **Personal development** — frameworks, habits, book summaries
- **Technical documentation** — APIs, architectures, design patterns
- **Hobby deep-dives** — any subject you want to master
## License
MIT
---
title: "Docker Knowledge Base — Index"
type: index
updated: 2026-07-07
---
# Docker — Knowledge Base
Docker packages applications into containers: portable, isolated processes that
share the host kernel. This wiki covers the open-source Docker Engine and CLI,
the Dockerfile, image building (BuildKit), Docker Compose, container runtime,
networking, storage, the daemon, the Engine API, and security. Scope is the
open-source engine plus Compose - not Docker Desktop, Scout, Hub, or
enterprise features.
Master catalog - every page appears here.
## Concepts
### Core
- [[concepts/what-is-docker]] - containers vs VMs, the client/daemon/registry architecture
- [[concepts/images-and-registries]] - image layers, tags, digests, pull/push, registries
- [[concepts/installation]] - installing Docker Engine per platform
### Building
- [[concepts/dockerfile-reference]] - every Dockerfile instruction and its syntax
- [[concepts/building-images]] - docker build, BuildKit, multi-stage, cache, secrets
- [[concepts/docker-cli]] - the `docker` CLI, global options, key commands
### Running
- [[concepts/containers-and-runtime]] - the container lifecycle and `docker run` flags
- [[concepts/networking]] - network drivers, port publishing, service discovery
- [[concepts/storage-and-volumes]] - volumes, bind mounts, tmpfs
### Compose
- [[concepts/docker-compose]] - the `docker compose` CLI and project model
- [[concepts/compose-file-reference]] - the compose.yaml specification
### Engine & operations
- [[concepts/docker-engine-and-daemon]] - dockerd, daemon.json, storage/log drivers, rootless
- [[concepts/engine-api]] - the Docker Engine REST API and versioning
- [[concepts/security]] - namespaces/cgroups, capabilities, rootless, secrets, trust
## Syntheses
- [[syntheses/dockerfile-best-practices]] - layer caching, multi-stage, image size
- [[syntheses/volumes-vs-bind-mounts]] - volumes vs bind mounts vs tmpfs
- [[syntheses/run-vs-compose]] - docker run vs Docker Compose
## XL edition (Pro)
Deeper per-item reference is available to Pro subscribers under this wiki's XL
edition (not listed above): full CLI flag tables (containers, images, build,
network, volume, system, swarm), the complete Compose file specification, every
Dockerfile instruction, and the Engine API reference — 23 pages. Subscribe at /pro.
## Statistics
- **Total pages**: 17
- **Concepts**: 14
- **Entities**: 0
- **Summaries**: 0
- **Syntheses**: 3
---
title: "Building Images (docker build, BuildKit, buildx)"
type: concept
tags: [docker, build, buildkit, buildx, multi-stage, cache, well-established]
created: 2026-07-07
updated: 2026-07-07
sources: ["raw/llms_txt_doc-docker-build.md", "raw/llms_txt_doc-dockerfile.md", "raw/llms_txt_doc-docker-cli.md"]
confidence: high
---
## Definition
Docker Build is one of Docker Engine's most-used features: whenever you create an image, you are using Docker Build. It packages and bundles your code so you can ship it anywhere. Build is more than a single command - it is an ecosystem of tools and features (BuildKit, buildx, multi-stage builds, multi-platform images, build drivers, exporters, build caching, and Bake) that support both common workflows and advanced scenarios. The input is a [[concepts/dockerfile-reference|Dockerfile]]; the output is an [[concepts/images-and-registries|image]].
## How It Works
`docker build` reads a Dockerfile and a build context (the set of files sent to the builder, usually the current directory `.`) and produces an image. The modern build backend is **BuildKit**, the open-source build engine, invoked through **buildx** (`docker buildx build`, also the default behind `docker build` on current Engine). BuildKit parallelizes independent build steps, skips unused stages, and manages a content-addressable cache.
Basic invocation:
```
docker build -t name:tag .
docker buildx build -t name:tag .
```
Common flags: `-t`/`--tag` (name the image), `-f`/`--file` (Dockerfile path), `--build-arg` (set an `ARG`), `--target` (stop at a named stage), `--no-cache` (ignore cache), `--pull` (always fetch a newer base), `--platform` (target architecture(s)), `--secret`, `--ssh`, `--push`/`--load`/`--output` (where to send the result). Progress output type is controlled by `BUILDKIT_PROGRESS` (`auto`, `plain`, `tty`, `rawjson`).
**Multi-stage builds** keep images small and secure with minimal dependencies. Each `FROM` starts a new stage; name a stage with `AS`, then copy only the needed artifacts forward with `COPY --from=`:
```
FROM golang:1.22 AS builder
WORKDIR /src
COPY . .
RUN go build -o /app
FROM alpine:3.20
COPY --from=builder /app /app
ENTRYPOINT ["/app"]
```
Only the final stage's layers ship, so build-time toolchains never reach the runtime image. `--target builder` builds just that stage (useful for a test or debug target).
**Build cache.** Each Dockerfile instruction produces a cache layer; on rebuild, BuildKit reuses layers whose inputs are unchanged and rebuilds from the first change downward. Ordering instructions from least- to most-frequently-changing (dependencies before source) maximizes reuse. `RUN --mount=type=cache,target=
` persists a cache directory (for example a package manager cache) across builds without baking it into the image. Cache can also be exported/imported across machines via cache backends (inline, registry, local, GitHub Actions, S3, Azure Blob).
## Key Parameters
**Build arguments** parameterize a build. Declare with `ARG` in the Dockerfile and pass at build time:
```
docker build --build-arg VERSION=1.2.3 -t app:1.2.3 .
```
`ARG`s declared before the first `FROM` are global and usable in `FROM` lines. Note that build args are visible in image history and should not carry secrets.
**Build secrets** provide credentials to a build without persisting them in the image or its layers. Mount a secret into a single `RUN` step:
```
RUN --mount=type=secret,id=mytoken \
TOKEN=$(cat /run/secrets/mytoken) some-command
```
```
docker build --secret id=mytoken,src=./token.txt .
```
The secret is available only during that `RUN` and is never written to the final image. `RUN --mount=type=ssh` similarly forwards an SSH agent for fetching private dependencies.
**Multi-platform images** let you build, push, pull, and run images across architectures (for example `linux/amd64` and `linux/arm64`) from a single command:
```
docker buildx build --platform linux/amd64,linux/arm64 -t name:tag --push .
```
`DOCKER_DEFAULT_PLATFORM` sets a default for commands that take `--platform`. BuildKit exposes built-in build args such as `BUILDKIT_INLINE_CACHE` (embed cache metadata) and `BUILDKIT_CONTEXT_KEEP_GIT_DIR`.
**Exporters and drivers.** Build drivers configure where and how builds run (the default `docker` driver, or `docker-container`/`kubernetes`/`remote` for advanced features like multi-platform and cache export). Exporters let you output artifacts other than a Docker image (e.g. a local tarball or filesystem) via `--output`. Bake (`docker buildx bake`) orchestrates multiple builds from a declarative file.
## When To Use
- **Any time you produce an image** from source - `docker build` is the entry point.
- **Multi-stage** whenever build tools (compilers, dev headers) should not ship in the runtime image, or to produce test/lint/debug targets from one Dockerfile.
- **Build secrets** for registry tokens, SSH keys, or API credentials needed only during the build.
- **Multi-platform** when the same image must run on both x86 and ARM (Apple Silicon, Graviton, Raspberry Pi).
- **Cache mounts and remote cache** to speed up CI, where the local layer cache is cold on every run.
## Risks & Pitfalls
- **Secrets in `--build-arg` or `ENV` leak.** Build args and env values are recoverable from image history; use `--secret` / `RUN --mount=type=secret` instead. See [[concepts/security]].
- **A large build context is slow.** Everything in the context directory is sent to the builder; use a `.dockerignore` file to exclude `node_modules`, `.git`, and build output.
- **Cache invalidation cascades.** Changing an early instruction (e.g. `COPY . .` before installing dependencies) busts the cache for every step after it. Copy dependency manifests and install before copying the full source.
- **`--platform` without an emulator or the right driver fails.** Cross-building non-native architectures needs QEMU/binfmt and often the `docker-container` driver.
- **`--push` vs `--load`.** Multi-platform results cannot be loaded into the local single-arch image store; you must `--push` to a registry (or `--output`).
- **Stale base images.** `docker build` reuses a cached base; add `--pull` to force fetching a newer base image.
## Related Concepts
- [[concepts/dockerfile-reference]]
- [[concepts/images-and-registries]]
- [[concepts/docker-cli]]
- [[syntheses/dockerfile-best-practices]]
- [[concepts/what-is-docker]]
## Sources
- `raw/llms_txt_doc-docker-build.md`
- `raw/llms_txt_doc-dockerfile.md`
- `raw/llms_txt_doc-docker-cli.md`
---
title: "Compose File Reference"
type: concept
tags: [compose, yaml, reference, services, configuration]
created: 2026-07-07
updated: 2026-07-07
sources: ["raw/llms_txt_doc-compose-file.md", "raw/llms_txt_doc-compose-cli.md"]
source_url: "https://docs.docker.com/reference/compose-file/"
confidence: high
---
## Definition
The Compose file (`compose.yaml`) configures a Docker application's services, networks, volumes, and more. The **Compose Specification** is the latest and recommended version of the Compose file format. Legacy versions 2.x and 3.x of the format were merged into the Compose Specification, which is implemented in versions 1.27.0 and above of the Docker Compose CLI (also known as Compose v2). By default Compose looks for `compose.yaml` or `docker-compose.yaml`.
## Top-level elements
A Compose file is organized into these top-level keys:
- `version` and `name` - version and name attributes for the Compose file
- `services` - the containers that make up the application (the primary element)
- `networks` - networks the services attach to
- `volumes` - named volumes for persistent data
- `configs` - configuration data made available to services
- `secrets` - sensitive data made available to services
## The `services` element
Each entry under `services` names one service and configures the container(s) that run it. Common service keys:
- `image` - the image to run, e.g. `image: examples/web`
- `build` - build context / instructions when the image is built locally, e.g. `build: .`
- `ports` - published ports, in `"HOST:CONTAINER"` form, e.g. `- "8000:8000"`
- `environment` - environment variables, e.g. `- DEBUG=1`
- `volumes` - mounts, e.g. `- "/data"` (also named volumes and bind mounts)
- `depends_on` - express startup/shutdown dependencies between services
- `healthcheck` - define a health probe; other services can wait on it with `depends_on`
- `deploy` - deployment/runtime constraints (replicas, resource limits, restart policy in Swarm)
- `restart` - restart policy for the service's containers
- `networks` - which top-level networks this service joins
- `secrets` / `configs` - grant the service access to declared secrets/configs
- `profiles` - assign the service to one or more profiles so it starts only when that profile is enabled
A minimal example combining several keys (from the Compose CLI reference):
```yaml
services:
webapp:
image: examples/web
ports:
- "8000:8000"
volumes:
- "/data"
```
Overriding the same service across multiple files - matching fields override the previous file, new values add to the service configuration:
```yaml
services:
webapp:
build: .
environment:
- DEBUG=1
```
## Merging and overriding files
When you supply multiple files with `-f`, Compose combines them into a single configuration in the order supplied; subsequent files override and add to their predecessors. If a later file specifies the same service, any matching fields override the earlier file and new values add to the service. All paths in the files are relative to the first configuration file specified with `-f` (override with `--project-directory`). This layering is the mechanism behind `compose.override.yaml` and environment-specific overrides (for example a base `compose.yaml` plus `compose.admin.yaml`).
## Startup order
Startup and shutdown order is controlled with `depends_on` together with health checks: a `healthcheck` on one service lets dependent services wait until it reports healthy before starting. In the dry-run example from the CLI docs, the `backend` and `proxy` services wait until the `db` service is healthy before starting.
## Profiles
Services can be tagged with `profiles`. A service assigned to a profile only starts when that profile is enabled (via `--profile`, `COMPOSE_PROFILES`, or by being a dependency of an enabled service). Services with no profile always start. This keeps optional components (debug tooling, seed jobs, alternate frontends) out of the default `up`.
## Project name in the file
The top-level `name:` key sets the project name from within the file. It sits below the `-p` flag and `COMPOSE_PROJECT_NAME` in precedence but above the directory basename. When multiple files are merged, the last `name:` wins.
## Related Concepts
- [[concepts/docker-compose]] - the `docker compose` CLI that reads this file
- [[concepts/containers-and-runtime]] - the underlying container runtime keys map to `docker run` flags
- [[concepts/networking]] - the `networks` top-level element
- [[concepts/storage-and-volumes]] - the `volumes` top-level element
- [[concepts/dockerfile-reference]] - what `build:` compiles
- [[syntheses/run-vs-compose]] - declarative Compose vs imperative `docker run`
## Sources
- raw/llms_txt_doc-compose-file.md
- raw/llms_txt_doc-compose-cli.md
---
title: "Containers and the Runtime"
type: concept
tags: [containers, runtime, docker-run, lifecycle, cli]
created: 2026-07-07
updated: 2026-07-07
sources: ["raw/llms_txt_doc-docker-concepts.md", "raw/llms_txt_doc-docker-cli.md", "raw/llms_txt_doc-what-is-docker.md"]
source_url: "https://docs.docker.com/reference/cli/docker/"
confidence: high
---
## Definition
A container is a runnable instance of an image - an isolated process with all of the files it needs to run. Containers are self-contained, isolated, independent, and portable: each has everything it needs to function with no reliance on pre-installed host dependencies, runs in isolation from the host and other containers, is independently managed (deleting one doesn't affect others), and runs the same way anywhere. Unlike a virtual machine, a container does not carry its own OS kernel; multiple containers share the host kernel, letting you run more applications on less infrastructure. You can create, start, stop, move, or delete a container using the Docker API or CLI, connect it to one or more networks, attach storage to it, or create a new image based on its current state.
## What happens on `docker run`
Running `docker run -i -t ubuntu /bin/bash` (assuming default registry configuration):
1. If the `ubuntu` image isn't local, Docker pulls it from the configured registry (as if you ran `docker pull ubuntu`).
2. Docker creates a new container (as if you ran `docker container create`).
3. Docker allocates a read-write filesystem to the container as its final layer, so the running container can create or modify files.
4. Docker creates a network interface to connect the container to the default network and assigns it an IP address (since no networking options were specified). By default, containers can reach external networks using the host's network connection.
5. Docker starts the container and executes `/bin/bash`. Because of `-i` and `-t`, the container runs interactively attached to your terminal.
When you `exit`, the container stops but isn't removed - you can start it again or remove it. When a container is removed, any changes to its state that aren't in persistent storage disappear.
## Container lifecycle commands
The base run syntax is:
```
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
```
Start a detached container publishing a port:
```
$ docker run -d -p 8080:80 docker/welcome-to-docker
```
`-d` runs the container in detached (background) mode; the command returns the full container ID.
List running containers (add `-a` to include stopped ones):
```
$ docker ps
$ docker ps -a
```
Stop a container by ID or name:
```
$ docker stop
```
When referencing a container by ID you only need enough of the ID to be unique, e.g. `docker stop a1f`.
The `docker container` management command groups the full lifecycle. Subcommands include: `attach`, `commit`, `cp`, `create`, `diff`, `exec`, `export`, `inspect`, `kill`, `logs`, `ls`, `pause`, `port`, `prune`, `rename`, `restart`, `rm`, `run`, `start`, `stats`, `stop`, `top`, `unpause`, `update`, and `wait`. The legacy top-level aliases (`docker run`, `docker ps`, `docker stop`, `docker rm`, `docker exec`, `docker logs`, `docker inspect`, ...) map onto these.
## Key `docker run` flags
- `-d, --detach` - run the container in the background
- `-p HOST:CONTAINER` - publish a container port to the host (e.g. `-p 8080:80`)
- `-v` - mount a volume or bind mount (e.g. `docker run -v /host:/container example/mysql`)
- `-e` - set an environment variable in the container
- `--name` - assign a name to the container (a string option, specified once)
- `--network` - connect the container to a specific network
- `--restart` - set a restart policy for the container
- `--rm` - automatically remove the container when it exits
- `-i, --interactive` - keep STDIN open; `-t, --tty` - allocate a pseudo-TTY
Single-character options can be combined: instead of `docker run -i -t --name test busybox sh`, write `docker run -it --name test busybox sh`. Boolean options default as shown in help text; specifying the flag without a value sets it to `true` (so `docker run -d` runs detached). Options that default to `true` (e.g. `docker build --rm=true`) are turned off with `--rm=false`. Multi-value options like `-a` and `-v` can be repeated in one command line.
## Detaching and re-attaching
Once attached to a container, detach and leave it running with the `CTRL-p CTRL-q` key sequence. The sequence is customizable via the `detachKeys` property in `config.json` or per-command with `--detach-keys` on `docker attach`, `docker exec`, `docker run`, or `docker start`.
## Related Concepts
- [[concepts/docker-cli]] - the full `docker` command surface and environment variables
- [[concepts/images-and-registries]] - the images containers instantiate
- [[concepts/networking]] - `--network`, `-p`, and container networking
- [[concepts/storage-and-volumes]] - `-v` / `--mount` and persistence
- [[concepts/docker-compose]] - declarative multi-container runtime
- [[syntheses/run-vs-compose]] - `docker run` vs Compose
## Sources
- raw/llms_txt_doc-docker-concepts.md
- raw/llms_txt_doc-docker-cli.md
- raw/llms_txt_doc-what-is-docker.md
---
title: "Docker CLI"
type: concept
tags: [docker, cli, commands, reference, well-established]
created: 2026-07-07
updated: 2026-07-07
sources: ["raw/llms_txt_doc-docker-cli.md", "raw/llms_txt_doc-docker-concepts.md"]
confidence: high
---
## Definition
`docker` is the base command for the Docker CLI and the primary way most users interact with Docker. When you run a command such as `docker run`, the client sends it to the daemon (`dockerd`) over the Docker API, and the daemon carries it out. The client can talk to more than one daemon. To list help on any command, append `--help`, for example `docker run --help`.
## How It Works
**Global options** apply to the `docker` command itself and select which daemon to talk to and how:
```
--config Location of client config files (default /root/.docker)
-c, --context Name of the context to use (overrides DOCKER_HOST)
-D, --debug Enable debug mode
-H, --host Daemon socket to connect to
-l, --log-level Set logging level (debug, info, warn, error, fatal; default info)
--tls / --tlsverify / --tlscacert / --tlscert / --tlskey
```
The `-H`/`--host` flag accepts `unix://`, `tcp://`, `ssh://`, and `npipe://` schemes, e.g. `docker -H ssh://user@192.168.64.5 ps` or `docker -H tcp://174.17.0.1:2376 ps`. By convention the daemon uses port `2376` for secure TLS and `2375` for insecure connections. Default sockets are `unix:///var/run/docker.sock` on macOS/Linux and `npipe:////./pipe/docker_engine` on Windows. See [[concepts/docker-engine-and-daemon]].
**Option types.** Single-character options can be combined (`docker run -it` == `docker run -i -t`). Boolean flags default as shown in help; specifying the flag without a value sets it true, and flags that default to true are disabled explicitly, e.g. `docker build --rm=false .`.
**Environment variables** that control the client include `DOCKER_HOST` (daemon socket), `DOCKER_CONTEXT` (context name, overrides `DOCKER_HOST`), `DOCKER_CONFIG` (config directory), `DOCKER_API_VERSION`, `DOCKER_DEFAULT_PLATFORM` (default for `--platform`), `DOCKER_TLS_VERIFY`, and `BUILDKIT_PROGRESS` (`auto`, `plain`, `tty`, `rawjson`). Go's `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY` are also honored.
**Configuration file.** The CLI stores config in `~/.docker/config.json`. You can set default output formats (`psFormat`, `imagesFormat`, `statsFormat`, and more), credential stores (`credsStore`, `credHelpers`), automatic container/build proxies (`proxies`), and the detach key sequence (`detachKeys`, default `CTRL-p CTRL-q`).
## Key Parameters
Docker groups functionality under management commands (`docker container`, `docker image`, `docker network`, `docker volume`, `docker system`, `docker builder`/`buildx`, `docker compose`, `docker context`, etc.). The most-used commands, grouped by function:
**Run and manage container lifecycle:**
```
docker run [OPTIONS] IMAGE [COMMAND] [ARG...] # create and run a new container
docker ps # list running containers
docker ps -a # list all containers (incl. stopped)
docker stop
docker start
docker rm # remove a container
```
Common `docker run` flags: `-d` (detached/background), `-i` (keep STDIN open), `-t` (allocate a TTY), `-p host:container` (publish a port), `-P` (publish all exposed ports), `-v` / `--mount` (attach storage), `-e` (set env var), `--name` (name the container), `--rm` (remove on exit), `--network`, `--restart`. Example from the docs: `docker run -d -p 8080:80 docker/welcome-to-docker`, and `docker run -i -t ubuntu /bin/bash`.
**Inspect and observe:**
```
docker logs # fetch container logs (add -f to follow)
docker exec -it sh # run a command in a running container
docker inspect