diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 31fe0bd3..81492e05 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -69,6 +69,7 @@ export default defineConfig({ { text: "Hostname", link: "/guide/hostname" }, { text: "Remote Hosts", link: "/guide/remote-hosts" }, { text: "Container Actions", link: "/guide/actions" }, + { text: "Filters", link: "/guide/filters" }, { text: "Supported Env Vars", link: "/guide/supported-env-vars" }, { text: "Logging Files on Disk", link: "/guide/log-files-on-disk" }, { text: "Analytics", link: "/guide/analytics" }, diff --git a/docs/guide/filters.md b/docs/guide/filters.md new file mode 100644 index 00000000..7ffa5f95 --- /dev/null +++ b/docs/guide/filters.md @@ -0,0 +1,30 @@ +--- +title: Filter +--- + +# Filtering Containers + +Dozzle supports conditional filtering similar to Docker's [--filter](https://docs.docker.com/reference/cli/docker/container/ls/#filter) with `DOZZLE_FILTER` or `--filter`. Filters are passed directly to Docker to limit what Dozzle can see. For example, filtering by label is supported with `--filter "label=color"`, which is similar to `docker ps` command with `docker ps --filter "label=color"`. + +::: code-group + +```sh +docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --filter label=color +``` + +```yaml [docker-compose.yml] +version: "3" +services: + dozzle: + image: amir20/dozzle:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 8080:8080 + environment: + DOZZLE_FILTER: label=color +``` + +::: + +Common filters are `name` or `label` to limit Dozzle's access to containers.