# 使用 Homebrew, apk, chocolatey, MacPorts, Nix, pacman, zypper, apt, dnf, scoop, winget 安装 docker

查看 docker 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:docker
```

## 代理安全回答

docker controls containers, images, mounts, registries, and local build state that agents can use to reach host files.

- **凭据访问:** Reads Docker registry auth, mounted secrets, build args, and files exposed through volume mounts.
- **远程变更:** Can push images, change containers, and alter running local or remote Docker contexts.
- **发布/制品风险:** Can build and publish images that become production artifacts.
- **推荐控制:** Gate image pushes, privileged containers, host mounts, and context changes.
- **代理使用指南:** Allow local inspection and builds with constrained mounts; require approval for registry pushes and privileged execution.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install docker
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install docker
```

  证据: MacPorts ports tree: devel/docker/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add docker
```

  证据: Alpine Linux edge package indexes: docker from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#docker
```

  证据: nixpkgs package indexes: docker from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S docker
```

  证据: Arch Linux sync databases: docker from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install docker
```

  证据: openSUSE Tumbleweed package metadata: docker from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

- Debian apt (92%):

```sh
sudo apt install wmdocker
```

  证据: Debian stable package indexes: wmdocker from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install moby-engine
```

  证据: Fedora Rawhide package metadata: moby-engine from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install docker
```

  证据: Chocolatey community package catalog: docker from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','dispcalgui.install'

- Scoop (92%):

```sh
scoop install main/docker
```

  证据: Scoop official bucket manifest trees: bucket/docker.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Docker.DockerDesktop -e
```

  证据: Windows Package Manager source index: Docker.DockerDesktop from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:docker
- **软件包管理器:** Homebrew
- **版本:** 29.7.1
- **来源摘要:** Pack, ship and run any application as a lightweight container
- **主页:** <https://www.docker.com/>
- **仓库:** <https://github.com/docker/cli>
- **最后更新:** 2026-07-31T21:29:21Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- docker (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 29.7.1
## 项目历史与用法

Docker is the package that made container workflows a default part of developer tooling. The Homebrew docker formula installs the CLI, but the broader Docker project combines the command-line client, daemon, image format, registry workflows, Docker Hub, Docker Desktop, Compose, BuildKit, and related projects into the everyday vocabulary of build, ship, and run.

### 项目历史

Docker's documentation defines Docker as an open platform for developing, shipping, and running applications, using containers as lightweight isolated environments. The docker/cli repository is the home of the Docker CLI, the command-line client that talks to the Docker daemon over the Docker API.

Docker's architecture joined a local client, a daemon, images, containers, registries, and distribution workflows into one approachable developer interface. Over time, major parts of the ecosystem were split or formalized into related projects such as Docker Distribution, containerd, runc, BuildKit, Compose, and Docker Desktop.

### 采用历史

Docker spread because it made containerized development and CI/CD reproducible with ordinary commands such as docker build, run, pull, push, and compose-oriented workflows. Docker Hub provided the default public registry, and package managers made the CLI easy to install even on systems where the daemon or Desktop app came from a separate package.

The tool's adoption also reshaped packaging expectations. Application projects began shipping Dockerfiles, official images, compose files, and registry tags as part of their release surface. For many developers, installing docker became the practical entry point for running databases, language runtimes, build services, and whole application stacks locally.

### 使用方式

The docker command is the primary way many users interact with Docker. The client sends commands such as docker run to dockerd, which builds, runs, and distributes containers. Users pull and push images through registries, build images from Dockerfiles, inspect containers and images, manage networks and volumes, and configure CLI behavior in ~/.docker/config.json or through DOCKER_CONFIG.

### 为什么软件包爱好者会关心

For package nerds, docker is significant because it moved a large amount of software distribution from host-native packages to OCI-style images and registries. It also became a dependency of development workflows: a package manager entry for docker often means access to thousands of image-packaged tools rather than only one executable.

The CLI package is also interesting because it is only one face of Docker. On macOS, the standalone CLI, Docker Desktop, credential helpers, Compose, Buildx, and the daemon are related but not always delivered by the same package. That split makes docker a useful case study in how package managers model large developer platforms.

### 时间线

- 2013: Solomon Hykes first publicly demoed Docker at PyCon.
- Docker platform era: The official architecture centers on a docker client, dockerd daemon, Docker API, images, containers, and registries.
- CLI repository era: Docker CLI development lives in the docker/cli repository as the home of the command-line client.
- 2023: Docker v23 made BuildKit the default builder for Linux images, with the legacy builder deprecated in Docker documentation.
- 2026: Docker documentation still treats docker as the primary CLI for container lifecycle and registry workflows.

### Related projects

- Related projects include Docker Engine, Moby, containerd, runc, Docker Distribution, Docker Hub, Docker Desktop, Docker Compose, BuildKit, Buildx, and Docker credential helpers.

### 来源

- <https://docs.docker.com/get-started/docker-overview/>
- <https://docs.docker.com/reference/cli/docker/>
- <https://github.com/docker/cli>
- <https://www.docker.com/blog/docker-nine-years-young/>
- <https://docs.docker.com/engine/deprecated/#legacy-builder-for-linux-images>


## 安全说明

doc example: container infrastructure.

- **Geiger 风险:** orange / 高
- doc example: container infrastructure
- **审批门规则:** 6


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.docker/config.json

## Credential files

- Unix: ~/.docker/config.json
## 其他软件包管理器记录

- Debian apt - wmdocker - 1.5-4+b1: normalized package name match | Debian stable package indexes: wmdocker from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | System tray for KDE3/GNOME2 docklet applications
- Nix - docker: normalized package name match | nixpkgs package indexes: docker from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - wmdocker - 1.5-4build3: normalized package name match | Ubuntu 24.04 LTS package indexes: wmdocker from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | System tray for KDE3/GNOME2 docklet applications
- apk - docker - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Pack, ship and run any application as a lightweight container | https://www.docker.io/
- apk - docker-bash-completion - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for docker | https://www.docker.io/
- apk - docker-cli - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-cli from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Docker CLI | https://www.docker.io/
- apk - docker-doc - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Documentation for Docker | https://www.docker.io/
- apk - docker-engine - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-engine from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Docker Engine (dockerd) | https://www.docker.io/
- apk - docker-fish-completion - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for docker | https://www.docker.io/
- apk - docker-openrc - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Pack, ship and run any application as a lightweight container (OpenRC init scripts) | https://www.docker.io/
- apk - docker-rootless-extras - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-rootless-extras from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Extras to run docker as in rootless mode | https://docs.docker.com/engine/security/rootless/
- apk - docker-rootless-extras-openrc - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-rootless-extras-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | OpenRC scripts for running docker in rootless mode | https://www.docker.io/
- apk - docker-systemd - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-systemd from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Pack, ship and run any application as a lightweight container (systemd files) | https://www.docker.io/
- apk - docker-zsh-completion - 29.7.1-r0: normalized package name match | Alpine Linux edge package indexes: docker-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for docker | https://www.docker.io/
- dnf - moby-engine - 29.7.1-1.fc45: normalized package name match | Fedora Rawhide package metadata: moby-engine from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | The open-source application container engine | https://github.com/moby/moby
- pacman - docker - 1:29.7.1-1: normalized package name match | Arch Linux sync databases: docker from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Pack, ship and run any application as a lightweight container | https://www.docker.com/


## Combined YAML source

View the package source record on GitHub. [combined/docker.yml](https://github.com/mxcl/pkgdb/blob/main/combined/docker.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- approval-gate seed metadata
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
