# 使用 Homebrew, apk, Nix, pacman, zypper 安装 apko

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

## 安装

```sh
sudo av install brew:apko
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install apko
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add apko
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#apko
```

  证据: nixpkgs package indexes: pkgs/by-name/ap/apko/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S apko
```

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

- zypper (92%):

```sh
sudo zypper install apko
```

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

## 软件包事实

- **软件包键:** brew:apko
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/apko>
- **版本:** 1.2.23
- **来源摘要:** Build OCI images from APK packages directly without Dockerfile
- **主页:** <https://github.com/chainguard-dev/apko>
- **仓库:** <https://github.com/chainguard-dev/apko>
- **上游文档:** <https://edu.chainguard.dev/open-source/apko>
- **许可证:** Apache-2.0
- **源码归档:** <https://github.com/chainguard-dev/apko/archive/refs/tags/v1.2.23.tar.gz>
- **最后更新:** 2026-07-07T15:33:11Z
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- apko (cli)
- apko (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 1.2.23
- 管理器更新时间: 2026-07-07
- 本地数据: OK
- 上游仓库: https://github.com/chainguard-dev/apko
- 检测到的最新版本: v1.2.23 (当前)
## 项目历史与用法

apko is Chainguard's apk-based OCI image builder: it builds container images directly from APK package repositories and a declarative YAML file, without Dockerfiles or RUN steps. It belongs to the supply-chain-focused family of tools that treat packages, SBOMs, and reproducibility as first-class image-build inputs.

### 项目历史

The public repository was created in February 2022. The README says apko was created by Chainguard because they needed secure, reproducible container images for their tooling, with speed important because images are rebuilt constantly for new versions and patches.

The design is explicitly declarative. Official docs state that apko files are YAML definitions of an image and that, unlike Dockerfiles, there is no equivalent of RUN statements. That restriction lets apko make stronger claims about image contents and reproducibility and generate metadata such as SBOMs.

apko is paired with melange, Chainguard's tool for building APK packages from source. The README frames melange plus apko as covering most use cases: package software into APKs with melange, then assemble minimal OCI images from those packages with apko.

### 采用历史

The README documents Homebrew installation, go install from source, and use of the cgr.dev/chainguard/apko container image. The supplied package metadata also records packaging in Alpine apk, Homebrew, Nix, pacman, and zypper, which fits a tool aimed at distro and container-package workflows.

GitHub repository metadata showed over 1.6k stars and an active release stream. The latest official release assets include signed binaries and checksums, reflecting packaging practices expected in supply-chain-oriented infrastructure tools.

### 使用方式

A typical apko file specifies APK repositories and packages under contents, then image metadata such as entrypoint, command, environment, accounts, paths, architectures, annotations, and layering. apko build writes a tar image, while apko publish pushes directly to a registry.

There is no fixed user config file location in the official docs; users pass an apko YAML file path to the CLI. The file can include another local file or a file from a remote git repository.

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

apko is important to package nerds because it moves image construction from shell-script layers to package-manager inputs. Instead of a Dockerfile mutating a filesystem, an image is a closure over APK repositories, package names, keys, accounts, paths, and metadata.

For distroless-style images, SBOM generation, rebuild speed, and bit-for-bit reproducibility, apko is a concrete example of packaging discipline influencing container image tooling.

### 时间线

- 2022: Public chainguard-dev/apko repository created on GitHub.
- 2022: README quickstart already showed apk-package-based Alpine image builds and SBOM generation.
- 2022: Companion melange repository was created for building APK packages from source.
- 2026: Official release stream reached the v1.2.x series with signed multi-platform binaries.

### Related projects

- The README names melange as apko's sister tool for producing APK packages, and says apko's design is influenced by ko and distroless. It also points to kontain.me as related declarative image-building work.

### 来源

- <https://api.github.com/repos/chainguard-dev/apko>
- <https://api.github.com/repos/chainguard-dev/apko/releases>
- <https://api.github.com/repos/chainguard-dev/melange>
- <https://github.com/chainguard-dev/apko#readme>
- <https://github.com/chainguard-dev/apko/blob/main/docs/apko_file.md>
- source_facts.package-manager


## 安全说明

没有找到 apko 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** apko
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Nix - apko: normalized package name match | nixpkgs package indexes: pkgs/by-name/ap/apko/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - apko - 0.9.0-r25: normalized package name match | Alpine Linux edge package indexes: apko from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | declarative APK-based container building tool with support for Sigstore signatures | https://github.com/chainguard-dev/apko
- apk - apko-bash-completion - 0.9.0-r25: normalized package name match | Alpine Linux edge package indexes: apko-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for apko | https://github.com/chainguard-dev/apko
- apk - apko-fish-completion - 0.9.0-r25: normalized package name match | Alpine Linux edge package indexes: apko-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for apko | https://github.com/chainguard-dev/apko
- apk - apko-zsh-completion - 0.9.0-r25: normalized package name match | Alpine Linux edge package indexes: apko-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for apko | https://github.com/chainguard-dev/apko
- pacman - apko - 1.2.15-1: normalized package name match | Arch Linux sync databases: apko from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Declarative APK-based container building tool with support for sigstore signatures | https://github.com/chainguard-dev/apko
- zypper - apko - 1.2.16-1.1: normalized package name match | openSUSE Tumbleweed package metadata: apko from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Build OCI images from APK packages directly without Dockerfile | https://github.com/chainguard-dev/apko
- zypper - apko-bash-completion - 1.2.16-1.1: normalized package name match | openSUSE Tumbleweed package metadata: apko-bash-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Bash Completion for apko | https://github.com/chainguard-dev/apko
- zypper - apko-fish-completion - 1.2.16-1.1: normalized package name match | openSUSE Tumbleweed package metadata: apko-fish-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Fish Completion for apko | https://github.com/chainguard-dev/apko
- zypper - apko-zsh-completion - 1.2.16-1.1: normalized package name match | openSUSE Tumbleweed package metadata: apko-zsh-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Zsh Completion for apko | https://github.com/chainguard-dev/apko


## 相关链接

- [Cloud CLI packages](https://www.automicvault.com/zh-hans/pkg/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/zh-hans/pkg/brew/go/) - Build dependency declared by Homebrew.
- [skopeo](https://www.automicvault.com/zh-hans/pkg/brew/skopeo/) - Shares av.db curated category or tags: cli, cloud-infrastructure, images, oci.
- [container](https://www.automicvault.com/zh-hans/pkg/brew/container/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [containerd](https://www.automicvault.com/zh-hans/pkg/brew/containerd/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [dcp](https://www.automicvault.com/zh-hans/pkg/brew/dcp/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [oci-cli](https://www.automicvault.com/zh-hans/pkg/brew/oci-cli/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [oras](https://www.automicvault.com/zh-hans/pkg/brew/oras/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [rockcraft](https://www.automicvault.com/zh-hans/pkg/brew/rockcraft/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [timoni](https://www.automicvault.com/zh-hans/pkg/brew/timoni/) - Shares av.db curated category or tags: cli, cloud-infrastructure, oci.
- [crane](https://www.automicvault.com/zh-hans/pkg/brew/crane/) - Local package facts share a topical domain. Shared terms: cli, cloud, cloud-infrastructure, images, infrastructure.
- [crossplane](https://www.automicvault.com/zh-hans/pkg/brew/crossplane/) - Local metadata places this package in an adjacent workflow. Shared terms: build, cli, cloud, cloud-infrastructure, infrastructure.

## Combined YAML source

View the package source record on GitHub. [combined/apko.yml](https://github.com/automic-vault/db/blob/main/combined/apko.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
